diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 51dc3709..3d95afe2 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -94,10 +94,12 @@ function SvgCanvas(c) out += "<" + elem.nodeName; for (i=attrs.length-1; i>=0; i--) { attr = attrs.item(i); - out += " " + attr.nodeName + "=\"" + attr.nodeValue+ "\""; + if (attr.nodeValue != "") { + out += " " + attr.nodeName + "=\"" + attr.nodeValue+ "\""; + } } if (elem.hasChildNodes()) { - out += ">"; + out += ">\n"; indent++; for (i=0; i"; + out += "\n"; } else { - out += " />"; + out += " />\n"; } } return out; @@ -565,8 +567,8 @@ function SvgCanvas(c) this.save = function() { // remove the selected outline before serializing this.selectNone(); - var str = "" - str += ""; + var str = "\n"; + str += "\n"; str += svgToString(svgroot, 0); this.saveHandler(str); }