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
Removing the /src/node/xml.js workaround would also solve other encoding issues like the following:
If data attribute of a item contains < or >, then exportSVG({asString: true}) doesn't encodes these characters as < or > which causes issues if such a XML will be opened in chrome.
This page contains the following errors:
error on line 3 at column 57: Unescaped '<' not allowed in attributes values
Below is a rendering of the page up to the first error.
constpath=newpaper.Path('M0,0 L10,0 10,10 0,10 Z');path.fillColor=newpaper.Color('blue');path.data='Is << unescaped?';paper.project.activeLayer.addChildren([path]);// Chrome shows the following error: // error on line 1 at column 482: Unescaped '<' not allowed in attributes valuesconsole.log('xml.js Serialize',paper.project.exportSVG({asString: true}));constsvgNode=paper.project.exportSVG()asSVGElement;constwindow=newjsdom.JSDOM('<body></body>').window;console.log('jsdom Serialize',newwindow.XMLSerializer().serializeToString(svgNode));
Expected result
Unsupported characters like < and > should be encoded at the attributes if paper.project.exportSVG({ asString: true}) will be called in case of node.
Additional information
Windows 10 Pro 10586.962, Node 14.16.1, jsdom 16.5.3
The text was updated successfully, but these errors were encountered:
curvedriver
changed the title
node - Encoding of unsupported character like '<' or '>'
node - Encoding of unsupported characters like '<' or '>'
Apr 27, 2021
curvedriver
changed the title
node - Encoding of unsupported characters like '<' or '>'
node - Escape unsupported characters like '<' or '>'
May 3, 2021
Description/Steps to reproduce
It seems that src/node/xml.js is no longer necessary since jsdom 16 because the references issues are solved:
Removing the
/src/node/xml.js
workaround would also solve other encoding issues like the following:If data attribute of a item contains
<
or>
, then exportSVG({asString: true}) doesn't encodes these characters as<
or>
which causes issues if such a XML will be opened in chrome.test-case
Serialize linearGradient with jsdom 16
Serialize path.data which includes
<
and ´>`Expected result
Unsupported characters like
<
and>
should be encoded at the attributes ifpaper.project.exportSVG({ asString: true})
will be called in case of node.Additional information
Windows 10 Pro 10586.962, Node 14.16.1, jsdom 16.5.3
The text was updated successfully, but these errors were encountered: