diff --git a/bench/simple_data_bench.exs b/bench/simple_data_bench.exs index 7d347af3..207a041f 100644 --- a/bench/simple_data_bench.exs +++ b/bench/simple_data_bench.exs @@ -147,8 +147,8 @@ defmodule Bench.SimpleDataBench do there are exterior bars. However in order to be more GFM compatible the `gfm_tables: true` option - can be used to interpret only interior vertical bars as a table if a seperation - line is given, therefor + can be used to interpret only interior vertical bars as a table if a separation + line is given, therefore Language|Rating --------|------ @@ -426,7 +426,7 @@ defmodule Bench.SimpleDataBench do **Rationale**: The AST is exposed in the spirit of [Floki's](https://hex.pm/packages/floki) there might be some subtle WS - differences and we chose to **always** have tripples, even for comments. + differences and we chose to **always** have triples, even for comments. We also do return a list for a single node diff --git a/lib/earmark/ast_tools.ex b/lib/earmark/ast_tools.ex index ded727fd..3131f495 100644 --- a/lib/earmark/ast_tools.ex +++ b/lib/earmark/ast_tools.ex @@ -5,7 +5,7 @@ defmodule Earmark.AstTools do @doc """ - A helper to merge attributes in their cannonical representation + A helper to merge attributes in their canonical representation iex(1)> merge_atts([{"href", "url"}], target: "_blank") diff --git a/lib/earmark/transform.ex b/lib/earmark/transform.ex index a5819237..e501848c 100644 --- a/lib/earmark/transform.ex +++ b/lib/earmark/transform.ex @@ -121,7 +121,7 @@ defmodule Earmark.Transform do is the quadtuples of the AST which are of the form `{tag, atts, content, meta}` All postprocessors can just be functions on nodes or a `TagSpecificProcessors` struct which will group - function applications depending on tags, as a convienience tuples of the form `{tag, function}` will be + function applications depending on tags, as a convenience tuples of the form `{tag, function}` will be transformed into a `TagSpecificProcessors` struct. iex(4)> add_class1 = &Earmark.AstTools.merge_atts_in_node(&1, class: "class1") @@ -310,7 +310,7 @@ defmodule Earmark.Transform do end @doc ~S""" - This too is a structure perserving transformation but a value is passed to the mapping function as an accumulator, and the mapping + This too is a structure preserving transformation but a value is passed to the mapping function as an accumulator, and the mapping function needs to return the new node and the accumulator as a tuple, here is a simple example iex(14)> {:ok, ast, _} = Earmark.Parser.as_ast("- 1\n\n2\n- 3\n") @@ -454,7 +454,7 @@ defmodule Earmark.Transform do defp escape(element, options) - defp escape("", _opions) do + defp escape("", _options) do [] end @@ -463,7 +463,7 @@ defmodule Earmark.Transform do # It doesn't seem possible to make _escape_to_iodata1 # transform, for example, "--'" to "–‘" without # significantly complicating the code to the point - # it outweights the performance benefit. + # it outweighs the performance benefit. element = element |> replace(~r{(^|[-–—/\(\[\{"”“\s])'}, "\\1‘") @@ -498,7 +498,7 @@ defmodule Earmark.Transform do |> Enum.take(level * indent) end - # Optimized HTML escaping + smartypants, insipred by Plug.HTML + # Optimized HTML escaping + smartypants, inspired by Plug.HTML # https://github.com/elixir-plug/plug/blob/v1.11.0/lib/plug/html.ex # Do not escape HTML entities diff --git a/lib/earmark_parser.ex b/lib/earmark_parser.ex index 519c21c5..3d96083c 100644 --- a/lib/earmark_parser.ex +++ b/lib/earmark_parser.ex @@ -328,7 +328,7 @@ defmodule Earmark.Parser do #### Lists - Lists are pretty much GFM compliant, but some behaviors concerning the interpreation of the markdown inside a List Item's first + Lists are pretty much GFM compliant, but some behaviors concerning the interpretation of the markdown inside a List Item's first paragraph seem not worth to be interpreted, examples are blockquote in a tight [list item](ttps://babelmark.github.io/?text=*+aa%0A++%3E+Second) which we can only have in a [loose one](https://babelmark.github.io/?text=*+aa%0A++%0A++%3E+Second) diff --git a/lib/earmark_parser/helpers/lookahead_helpers.ex b/lib/earmark_parser/helpers/lookahead_helpers.ex index 69e48ef1..053855ac 100644 --- a/lib/earmark_parser/helpers/lookahead_helpers.ex +++ b/lib/earmark_parser/helpers/lookahead_helpers.ex @@ -6,7 +6,7 @@ defmodule Earmark.Parser.Helpers.LookaheadHelpers do @doc """ Indicates if the _numbered_line_ passed in leaves an inline code block open. - If so returns a tuple whre the first element is the opening sequence of backticks, + If so returns a tuple where the first element is the opening sequence of backticks, and the second the linenumber of the _numbered_line_ Otherwise `{nil, 0}` is returned diff --git a/lib/earmark_parser/options.ex b/lib/earmark_parser/options.ex index b1957241..641277ca 100644 --- a/lib/earmark_parser/options.ex +++ b/lib/earmark_parser/options.ex @@ -124,7 +124,7 @@ defmodule Earmark.Parser.Options do def normalize(options), do: struct(__MODULE__, options) |> normalize() - defp _deprecate_old_messages(opitons) + defp _deprecate_old_messages(options) defp _deprecate_old_messages(%__MODULE__{messages: %MapSet{}} = options), do: options defp _deprecate_old_messages(%__MODULE__{} = options) do diff --git a/test/acceptance/html/compact_output_test.exs b/test/acceptance/html/compact_output_test.exs index 511dbcc8..c4d734f5 100644 --- a/test/acceptance/html/compact_output_test.exs +++ b/test/acceptance/html/compact_output_test.exs @@ -19,7 +19,7 @@ defmodule Acceptance.Html.CompactModeTest do assert html == expected end - test "does not preserve newlines in paragraphes" do + test "does not preserve newlines in paragraphs" do expected = "
\nhello world
\n" result = Earmark.transform( [{"p", [], ["hello\nworld"], %{}}], compact_output: true) diff --git a/test/acceptance/html/diverse_test.exs b/test/acceptance/html/diverse_test.exs index 5f70df4d..06a0a061 100644 --- a/test/acceptance/html/diverse_test.exs +++ b/test/acceptance/html/diverse_test.exs @@ -4,7 +4,7 @@ defmodule Acceptance.Html.DiverseTest do import ExUnit.CaptureIO describe "etc" do - test "entiy" do + test "entity" do markdown = "`föö`\n" html = "\nföö
\n\\code