You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I didn't check in detail, but presumably, String#trim() will remove any kind of Unicode whitespace, and there's quite a lot of variety there. If a space is non-breaking, I don't think SVGO should touch it.
Suggested fixes:
Replace String#trim() with something that only trims [ \t\r\n].
Add HTML elements to textElems so the else doesn't get hit.
Don't trim anything inside <foreignObject> to avoid implementing an entire HTML parser.
The text was updated successfully, but these errors were encountered:
Describe the bug
When parsing HTML in
<foreignObject>
, non-breaking spaces (
aka 
aka 
) are getting removed.To Reproduce
Even with
--pretty
, this becomesfoobarbaz
.Expected behavior
foobar baz
Desktop (please complete the following information):
Additional context
I've narrowed it down to:
svgo/lib/parser.js
Line 228 in a9834ef
I didn't check in detail, but presumably,
String#trim()
will remove any kind of Unicode whitespace, and there's quite a lot of variety there. If a space is non-breaking, I don't think SVGO should touch it.Suggested fixes:
String#trim()
with something that only trims[ \t\r\n]
.textElems
so theelse
doesn't get hit.<foreignObject>
to avoid implementing an entire HTML parser.The text was updated successfully, but these errors were encountered: