#!/usr/bin/env python import warnings as _warnings _warnings.resetwarnings() _warnings.filterwarnings('error') from tdi.tools import javascript x = javascript.cdata(u"""<!-- script1 //-->""") print repr(x) x = javascript.cdata("""<!-- script1 //-->""") print repr(x) x = javascript.cdata("""<!-- script1 - \xc3\xa9 //-->""", encoding='utf-8') print repr(x) x = javascript.cdata(u"""<![CDATA[ script2 ]]>""") print repr(x) x = javascript.cdata("""<![CDATA[ script2 ]]>""") print repr(x) x = javascript.cdata("""<![CDATA[ script2 - \xc3\xa9
#!/usr/bin/env python # -*- coding: utf-8 -*- import warnings as _warnings _warnings.resetwarnings() _warnings.filterwarnings('error') # BEGIN INCLUDE from tdi.tools import javascript print javascript.cdata(""" //<![CDATA[ the script. //]]> """.strip())