-
-
Couldn't load subscription status.
- Fork 260
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
XMLSerializer.serializeToString() converts non-breaking spaces in text nodes to , which is not a named entity in XML.
To Reproduce
// the <tspan> here contains a non-breaking space
const document = new DOMParser().parseFromString('<body><svg viewBox="0 0 240 40" xmlns="http://www.w3.org/2000/svg"><text x="10" y="30" class="small">test<tspan> </tspan></text></svg></body>', 'text/html');
const svg = document.querySelector('svg');
const serializer = new XMLSerializer();
serializer.serializeToString(svg); // <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 40"><text x="10" y="30" class="small">test<tspan> </tspan></text></svg>Expected behavior
Non-breaking spaces should be encoded as a numeric entity ( ) or left as-is
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working