jindw / xmldom

A PURE JS W3C Standard based(XML DOM Level2 CORE) DOMParser and XMLSerializer.
Other
819 stars 265 forks source link

encode entity "greater-than" (>) in text node #199

Open lseguin42 opened 7 years ago

lseguin42 commented 7 years ago

On browser : new DOMParser().parseFormString('<div>]]></div>', 'text/xml'); this code throw an error.

we need to encode '>' for fix it.

reebayroo commented 7 years ago

Hey @lseguin42 how do you run the tests? npm test just runs a single one.

Holzhaus commented 7 years ago

I just ran node test/index.js. Anyway, this PR is chaotic beacause there are loads of completely unrelated whitespace changes. IMHO, this should be closed in favour of PR #207, which only escapes > if it was preceded by ]] (in accordance with Section 2.4. of the XML 1.0 spec).

lviggiani commented 7 years ago

Not encoding > to &gt; casues a lot of troubles if the try to format (pretty print) serialised XML text. It would be very helpful to have this pull request merged IMHO