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
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