Normalize \r\n to \n

This commit is contained in:
Patrick Steele-Idem 2014-10-07 10:24:29 -07:00
parent 714bbe7c1b
commit fbc55eff00

View File

@ -37,6 +37,11 @@ function TextNode(text, escapeXml) {
if (text != null && typeof text !== 'string') {
throw createError('Invalid text: ' + text);
}
if (text) {
text = text.replace(/\r\n/g, '\n');
}
this.text = text;
this.escapeXml = escapeXml !== false;
}