[ic] Using IE conditional tags with IC

Angus Rogerson arogerso at uwaterloo.ca
Mon Jan 24 03:02:50 UTC 2011



Hello,

I have some pages from my designer which include:

> <!-- conditional comment added for IE 6 printing, IE 5.5 will not print this page very well -->
> <!--[if gte IE 6]>
> import style sheets for IE
> <![endif] -->

The <!--[if ] ... [endif]--> construct is a 'feature' of IE which is transparent to other browsers. (Other browsers just see the initial <!-- and final --> and treat the whole thing as a comment.)

Unfortunately, Interchange interprets the [if gte IE 6] as ITL, and does not recognize the endif. So it sends this to the browser:

> <!-- conditional comment added for IE 6 printing, IE 5.5 will not print this page very well -->
> <!-->
> import style sheets for IE
> <![endif] -->

This does not meet the requirements of IE so <![endif] --> is displayed to the user.

Firefox does not display anything (since it knows that comments are <!-- to -->).

This page http://www.icdevgroup.org/docs/glossary/ITL.html explains how to use <!--[blah]--> and <!-- [blah] --> to hide IC code from HTML editors. The pragma described on http://www.icdevgroup.org/docs/pragmas/no_html_comment_embed.html does not seem to work (the pragma tag gets displayed on the page). This feature is available from 4.6 to 5.7, and I am on 5.4.

The pragma is not the best choice for me because it is page wide (so I can't use <!-- [dump -->).

Is there a trick to getting the pragma to work?

Is there a way to escape the square brackets or otherwise turn off parsing of this comment?

Thanks in advance.

Angus






More information about the interchange-users mailing list