mity / md4c

C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification.
MIT License
779 stars 146 forks source link

Tag `<gi att1=tok1 att2=tok2>` not recognized #2

Closed tin-pot closed 7 years ago

tin-pot commented 7 years ago

In md_is_html_tag(), state 41 "in middle of unquoted attribute value" is not exited when white space is encounterd. As a consequence, in the tag mentioned above the second = throws scanning off, we end up in the "unexpected" case, do return FALSE - and the tag is not recognized as such.

tin-pot commented 7 years ago

Here https://github.com/tin-pot/md4c/commit/e8c95ee4009e579455aeca7534c3ab4fa1d211cf is an obvious fix, but you might prefer using the ISWHITESPACE() macro.

Not sure about handling of new-line \n inside tags here and elsewhere ...

mity commented 7 years ago

Thanks for the report.

The fix is implemented a bit differently then your proposal, to handle the line breaks correctly: