This question deals with IE specific code blocks that work off special html comments. Is there any way that the code formatted could recognize these special format codes and still comment the javascript (and html) inside?

2 Answers 2


We can force certain language upon a code block by adding such a line above the code:

<!-- language: lang-[language here] -->

After quick trial and error, this one did the trick:

<!-- language: lang-js -->

More details can be found here.


I disagree that conditional comments should be handled by the default syntax highlighter. For one thing, they are an ancient relic, and even IE is discontinuing support for it – as the page you linked to says:

Important As of Internet Explorer 10, conditional comments are no longer supported by standards mode

Fun fact: Until 2012 (!), that page contained the following text instead:

Conditional comments make it easy for developers to take advantage of the enhanced features offered by Microsoft Internet Explorer 5 and later versions, while writing pages that downgrade gracefully in less-capable browsers or display correctly in browsers other than Windows Internet Explorer.

More importantly however, a conditional comment is just that – a comment. So in the context of HTML, it is correct for the syntax highlighter to highlight it as such.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .