Welcome! » Log In » Create A New Profile

html comments inside the script tag

Posted by cogo 
html comments inside the script tag
July 20, 2010 03:27AM

HTMLPurifier is removing HTML comments inside of the <script> tag:

<pre><![CDATA[ <script type="text/javascript"> <!-- some javascript code here //--> </script> ]]></pre>

becomes

<pre><![CDATA[ <script type="text/javascript"> some javascript code here //</script> ]]></pre>

I have set <b>Output.CommentScriptContents</b> to <b>false</b> and <b>HTML.Trusted</b> to <b>true</b>. If I set <b>Output.CommentScriptContents</b> to <b>true</b> HTMLPurifier adds its own comments. I would like it to just keep the comments already there. Is this possible?

Re: html comments inside the script tag
July 20, 2010 08:48PM

Unfortunately not: HTML Purifier's internal representation destroys comment guards and such.

asd
Re: html comments asdasd the script tag
February 14, 2017 06:42AM

fwefwef

kamlesh
testing
February 14, 2017 06:43AM

hello

kamlesh
Re: testing
February 14, 2017 06:45AM

tyty

test123
Re: html comments inside the script tag
April 14, 2017 01:40AM
Sorry, you do not have permission to post/reply in this forum.