Last active
December 15, 2015 19:18
-
-
Save davidjgraph/5309973 to your computer and use it in GitHub Desktop.
mxUtils.getXml patch in mxGraph 1.12.0.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mxUtils.getXml: function(node, linefeed) | |
{ | |
var xml = ''; | |
if (window.XMLSerializer != null) | |
{ | |
var xmlSerializer = new XMLSerializer(); | |
xml = xmlSerializer.serializeToString(node); | |
} | |
else if (node.xml != null) | |
{ | |
xml = node.xml.replace(/\r\n\t[\t]*/g, ''). | |
replace(/>\r\n/g, '>'). | |
replace(/\r\n/g, '\n'); | |
} | |
// Replaces linefeeds with HTML Entities. | |
linefeed = linefeed || '
'; | |
xml = xml.replace(/\n/g, linefeed); | |
return xml; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment