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:

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

The resulting structure is:

    <Child.Element name="first">
        <Child.Element name="second">
            <Child.Element name="third">
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


Issue Title Created Date Updated Date