Open spctrlth opened 3 months ago
backlink to downstream issue: https://akkoma.dev/AkkomaGang/akkoma/issues/829
I believe this is documented behavior, tags need to be in their own line (more or less) therefore
iex(2)> EarmarkParser.as_ast("<p>z\nz</p>")
{:error, [{"p", [], ["z", "z</p>"], %{verbatim: true}}],
[{:warning, 1, "Failed to find closing <p>"}]}
iex(3)> EarmarkParser.as_ast("<p>z\nz\n</p>")
{:ok, [{"p", [], ["z", "z"], %{verbatim: true}}], []}
That said we want the behavior you are expecting, I'll keep this open as a Feature Request
related are #7
For example, the following is correct:
It puts everything in a paragraph and the newline is turned into a
br
tag (as expected because of thebreaks: true
option)However, when we put tags ourselves, in this case
p
tags, but also happens with other HTML tagsThe newline
\n
is not converted to abr
tag (may be related to https://github.com/RobertDober/earmark_parser/issues/119 ?), and the closing tag is seen as part of the text instead of being detected as the closing tag.