HTML comments stripped from Jelly

bennyb
Kilo Contributor

Hi,

I've noticed HTML comments:


<!-- my html comment -->


get stripped from Jelly when rendered. This becomes a problem when using IE conditional statements to choose stylesheets/javascript:


<!--[if lte IE 7]><script></script><![endif]-->


Any thoughts on how I prevent HTML comments from being stripped or, use conditional IE statements in the CMS?

Cheers,
Ben
2 REPLIES 2

tony_fugere
Mega Guru

wrap that into CDATA tags in the XML file?



<![CDATA[
<!--[if lte IE 7]><script></script><![endif]-->
]]>


Thanks Tony,

works great!

Another solution was that I found that using html entities works when placed in a dynamic content block:



<!--[if gte IE 7]><!--><img src="/scs/logo.png" height="28" alt="Service Centre Online" /><!--<![endif]-->


This renders correctly in a browser:



<!--[if gte IE 7]><!--><img src="/scs/logo.png" height="28" alt="Service Centre Online" /><!--<![endif]-->


Your solution is cleaner though!

Cheers,
Ben