Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latest version xml comment is not ending as expecting #1823

Open
yuagonc opened this issue May 11, 2024 · 0 comments
Open

latest version xml comment is not ending as expecting #1823

yuagonc opened this issue May 11, 2024 · 0 comments

Comments

@yuagonc
Copy link

yuagonc commented May 11, 2024

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.

@yuagonc yuagonc changed the title latest version comment is not ending as expecting latest version xml comment is not ending as expecting May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant