RobertDober / earmark_parser

The Markdown to AST part of Earmark.
Apache License 2.0
68 stars 26 forks source link

Retain whitespace when parsing pure links #25

Closed sionide21 closed 4 years ago

sionide21 commented 4 years ago

Fixes #22

sionide21 commented 4 years ago

While working on this I discovered an issue that may be hiding problems in other tests. It appears that Floki drops whitespace only text nodes.

This means that the spec following spec would have actually passed before this change.

markdown = "**Test**     https://www.google.com"
html = "<p><strong>Test</strong>     <a href=\"https://www.google.com\">https://www.google.com</a></p>\n"
ast      = parse_html(html)
messages = []

assert as_ast(markdown) == {:ok, ast, messages}
RobertDober commented 4 years ago

Thank you for all of this, not easy to understand my code, unfortunately.

I'll check the Floki issue and rewrite the test accordingly, I shall not accept a false negative!

Oh you fixed that :clap:

RobertDober commented 4 years ago

I have checked it out into a feature branch for the issue at hand, be not alarmed not to find your code in master yet