Quote ampersend chars in XML text. Closes #263.

This commit is contained in:
Sandro Santilli 2013-03-22 11:11:16 +01:00
parent e9c1e3925d
commit ebf08584d3

View File

@ -7,7 +7,8 @@ tree.Quoted = function Quoted(content) {
tree.Quoted.prototype = {
toString: function(quotes) {
var xmlvalue = this.value.replace(/\'/g, ''');
var xmlvalue = this.value.replace(/&/g, '&');
xmlvalue = xmlvalue.replace(/\'/g, ''');
return (quotes === true) ? "'" + xmlvalue + "'" : this.value;
},