For example, the following is correct:
iex(1)> EarmarkParser.as_ast("z\nz", %EarmarkParser.Options{breaks: true})
{:ok, [{"p", [], ["z", {"br", [], [], %{}}, "z"], %{}}], []}
It puts everything in a paragraph and the newline is turned into a br tag (as expected because of the breaks: true option)
However, when we put tags ourselves, in this case p tags, but also happens with other HTML tags
iex(1)> EarmarkParser.as_ast("<p>z\nz</p>", %EarmarkParser.Options{breaks: true})
{:error, [{"p", [], ["z", "z</p>"], %{verbatim: true}}],
[{:warning, 1, "Failed to find closing <p>"}]}
The newline \n is not converted to a br tag (may be related to #119 ?), and the closing tag is seen as part of the text instead of being detected as the closing tag.