Self closing tags with periods in their name are parsed nested instead of as siblings

This issue has been tracked since 2021-11-18.

Code like this has the wrong tree structure after parsing:

<Parent.Element>
    <Child.Element name="first"/>
    <Child.Element name="second"/>
    <Child.Element name="third"/>
</Parent.Element>

The resulting structure is:

<Parent.Element>
    <Child.Element name="first">
        <Child.Element name="second">
            <Child.Element name="third">
</Parent.Element>
fb55 wrote this answer on 2021-11-19

Try enabling xmlMode!

jonas-k wrote this answer on 2021-11-19

Thank you for the quick response. Enabling xmlMode solved the problem.

More Details About Repo
Owner Name fb55
Repo Name htmlparser2
Full Name fb55/htmlparser2
Language TypeScript
Created Date 2011-08-27
Updated Date 2023-03-19
Star Count 3793
Watcher Count 50
Fork Count 370
Issue Count 4

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date