Skip to content

Inconsistent "span" behavior #467

Description

@josecarlosrx

When we have two spans next to each other and one of them is not enclosed properly, the later span text is added as a sibling of the span instead of as a child. This happens because of the space in </span >

If we enclose it properly it all works well. The thing is that formatters add tabs to html tags when the string is large.

A fix could be to use html.replace(/[\t\s]+\>/g, ">") to scape whitespace on enclosing tags, but it would be nice for this to be fixed inside xmldom.
To Reproduce
https://stackblitz.com/edit/js-xmldom-template-cvnj8l?file=index.js

Expected behavior
We want the span text to be a child of span.

Runtime & Version:
xmldom version: 0.8.6
runtime version: node 16.14.2
other related software and version: Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changeSome thing that requires a version bump due to breaking changesbugSomething isn't workingspec:HTMLstrategicxml:well-formedhttps://www.w3.org/TR/xml11/#dt-wellformed

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions