-
Notifications
You must be signed in to change notification settings - Fork 146
Description
Relevant links:
https://www.w3.org/TR/SVG2/struct.html#XMLSpaceAttribute
https://www.w3.org/TR/SVG2/text.html#WhiteSpaceProperty
The attribute xml:space is used to control white space in SVG 1.1 inside elements. As this is an XML attribute, it presumably must also follow XML rules for handling white-space only text nodes (different from text elements) which dictate that a value of "default" results in the removal of text nodes that only contain white space:
<text><tspan>A</tspan> <tspan>B</tspan></text> => AB
<text><tspan>A</tspan> B <tspan>C</tspan></text> => A B C
This behavior is not clearly defined in either the SVG 1.1 or SVG 2 specs and neither Firefox nor Chrome seem to follow this. Inkscape has followed this behavior (except due to a bug, now fixed, introduced by a change in the libxml2 library).
If this interpretation is wrong, then text should be added to the spec to make it clearer.
Note XHTML2 sets xml:space to preserve for all elements.
PS. It's a real pain that we can't attach SVG files!