Gisellameloni / svg-edit

Automatically exported from code.google.com/p/svg-edit
MIT License
0 stars 0 forks source link

XML entity escaping incomplete in toXml #1174

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
After loading svg with xlink:href='url("#test")', svgGetString returns
xlink:href="url("#test")". So, output string cannot be re-loaded.
utilities.toXml uses jQuery html() to escaping characters, but it won't convert 
" to &qut;.

so toXml should be such as:
svgedit.utilities.toXml = function(str) {
    var x = $('<p/>').text(str).html();
    while (x.indexOf('"') != -1)
        x = x.replace('"', '&quot;');
    return x;
};

toXml seems to be used to escape attribute value, text value, layer name in 
svgcanvas.

Original issue reported on code.google.com by psh....@gmail.com on 25 Jan 2014 at 6:28

GoogleCodeExporter commented 8 years ago
I have made a fix in trunk. Please test to confirm.

Original comment by bret...@gmail.com on 12 Feb 2014 at 10:11

GoogleCodeExporter commented 8 years ago
And thank you!

Original comment by bret...@gmail.com on 12 Feb 2014 at 10:11