fb55/htmlparser2

latest version xml comment is not ending as expecting

Opened this issue · 0 comments

for example

var content = ` <root><node>start</node><!--><node>should ignore</node><--><node>end</node></root> `
var result = htmlparser2.parseDocument(content, {xmlMode: true})

I get six children. And have the child <node>should ignore</node> and <-->.

According to xml format, comment is starting by <!-- and ending with -->
If save this as xml file and open with browser, the comment is recognized by the browser correctly.
I think <!--> should just be recognized as start, not as end at the same time.

I try to use version 5.0.1 which is used by astexplorer and use function parseDOM. Result is correct.