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

Parser unescapes &lt;, nodeToString leaves the < as is

Open malidukica opened this issue 1 year ago • 0 comments

Hello @hecrj, and thank you for the amazing library and work!

The issue that we came across is related to a roundtrip that we do, html string > html parser nodes > html string, since we need to do some adjustments to the html string.

We found out that the parser unescapes a &lt; to <, and stringifying it again leaves < as is (which in turn causes a parsing error when we try to parse the html string anew).

The example is given in the following ellie:

https://ellie-app.com/ndLhBgPfqvDa1

Are there any special considerations for this behaviour? (I'm not a huge expert in html sanitization and escaping)

malidukica avatar Jun 30 '23 14:06 malidukica