# HG changeset patch # User Maxim Dounin # Date 1713125471 -10800 # Node ID cc0402def1f9c4c8a8089cb2d8ad7795dd17668b # Parent 01dc9ba12e1ba472f22d6f1be3eaa3c2b4f2879e XSLScript: added CDATA support. Notably, this simplifies adding javascript code to templates, which otherwise require complex escaping. Requested by Igor Sysoev. diff --git a/xslscript.pl b/xslscript.pl --- a/xslscript.pl +++ b/xslscript.pl @@ -45,6 +45,7 @@ startrule : item(s) eofile { $return = $item{'item(s)'}; 1 } item : ").)*/ms "-->" { $return = ""; 1 } +# cdata, + +cdata : /((?!]]>).)*/ms "]]>" + { $return = ""; 1 } + # special chars: ', ", {, }, \ # if used in text, they needs to be escaped with backslash