htmljs-parser icon indicating copy to clipboard operation
htmljs-parser copied to clipboard

Closing tag names include trailing whitespace

Open AngusMorton opened this issue 1 year ago • 0 comments

The following HTML/Marko doesn't parse because the closeTagName is parsed with whitespace and so the open and close tag names don't match.

<span class="dolorum atque aspernatur"
  >Est molestiae sunt facilis qui rem.</span
>
<span class="dolorum atque aspernatur"
  >Est molestiae sunt facilis qui rem.</span
                                        ^^^^ 
       The closing "span\n" tag does not match the corresponding opening "span" tag.
>

I would expect the closeTagName to be "span" and the closeTagEnd to be "\n>"... But I don't know if that makes sense. Alternatively, we consume and discard the whitespace between closeTagName and closeTagEnd. I also don't know how this change would impact upstream dependencies.

AngusMorton avatar Feb 20 '24 11:02 AngusMorton