Closed c4710n closed 2 years ago
1.4.23
Example code:
markdown = """ A line with[^1] two references[^2] [^1]: oneline-without-whitespace [^2]: - Footnote 2.1 """ EarmarkParser.as_ast(markdown, footnotes: true)
Outputs:
{:error, [ {"p", [], [ "A line with[^1] two references", {"a", [ {"href", "#fn:2"}, {"id", "fnref:2"}, {"class", "footnote"}, {"title", "see footnote"} ], ["2"], %{}} ], %{}}, {"div", [{"class", "footnotes"}], [ {"hr", [], [], %{}}, {"ol", [], [ {"li", [{"id", "fn:2"}], [ {"a", [ {"class", "reversefootnote"}, {"href", "#fnref:2"}, {"title", "return to article"} ], ["↩"], %{}}, {"ul", [], [{"li", [], ["Footnote 2.1"], %{}}], %{}} ], %{}} ], %{}} ], %{}} ], [{:error, 1, "footnote 1 undefined, reference to it ignored"}]}
Everything is fine. For example:
markdown = """ A line with[^1] two references[^2] [^1]: oneline without whitespace [^2]: - Footnote 2.1 """ EarmarkParser.as_ast(markdown, footnotes: true)
{:ok, [ {"p", [], [ "A line with", {"a", [ {"href", "#fn:1"}, {"id", "fnref:1"}, {"class", "footnote"}, {"title", "see footnote"} ], ["1"], %{}}, " two references", {"a", [ {"href", "#fn:2"}, {"id", "fnref:2"}, {"class", "footnote"}, {"title", "see footnote"} ], ["2"], %{}} ], %{}}, {"div", [{"class", "footnotes"}], [ {"hr", [], [], %{}}, {"ol", [], [ {"li", [{"id", "fn:1"}], [ {"a", [ {"class", "reversefootnote"}, {"href", "#fnref:1"}, {"title", "return to article"} ], ["↩"], %{}}, {"p", [], ["oneline without whitespace"], %{}} ], %{}}, {"li", [{"id", "fn:2"}], [ {"a", [ {"class", "reversefootnote"}, {"href", "#fnref:2"}, {"title", "return to article"} ], ["↩"], %{}}, {"ul", [], [{"li", [], ["Footnote 2.1"], %{}}], %{}} ], %{}} ], %{}} ], %{}} ], []}
@c4710n thank you for that report
Thanks, Robert.
My pleasure: 1.4.24 with the fix is available
Version
1.4.23
Reproduce
Example code:
Outputs:
What about footnote with whitespace?
Everything is fine. For example:
Outputs: