XML escape instead of CDATA

This commit is contained in:
Hackerpilot 2013-07-27 13:45:46 +00:00
parent 36d397ac68
commit 44b7e7958e
1 changed files with 2 additions and 2 deletions

View File

@ -1267,7 +1267,7 @@ class XMLPrinter : ASTVisitor
case dollar: output.writeln("<dollar/>"); return;
default: output.writeln("<", getTokenValue(token.type), "/>"); return;
}
output.writeln("<", tagName, "><![CDATA[", token.value, "]]></", tagName, ">");
output.writeln("<", tagName, ">", xmlEscape(token.value), "</", tagName, ">");
}
override void visit(TraitsExpression traitsExpression)
@ -1447,7 +1447,7 @@ class XMLPrinter : ASTVisitor
private string xmlEscape(string s)
{
return s.translate(['<' : "&lt;", '>' : "&gt;"]);
return s.translate(['<' : "&lt;", '>' : "&gt;", '&', "&amp;"]);
}
File output;