This code should work properly. It works with Jade version up to 0.35.0 .
Note that the last html element must be a valid Jade element (so attributes are in parentheses (...) ). The first two elements are parts of comments and therefore must be formed as formatted HTML elements.
//if IE 8 <html lang="en" class="ie8"> //if IE 9 <html lang="en" class="ie9"> //[if !IE]><! html(lang="en") //<![endif]
The output on the page is as follows:
<html lang="en">
EDIT
Starting with version 1.0.0 (released on December 22, 2013 ), Jade no longer parses comment content and does not support IE conditional comment support.
A new approach is to use IE's well-formatted conditional comments. This is safe, because now Jade ignores any line starting with < .
Your code may be as follows:
html(lang="en")
Please note that the html element will be processed by Jade (with all its functions, for example, setting the class name from the request processing method), so you should NOT add | </html> | </html> at the end of your jade file.
You can also refer to IE conditional comments in the Jade Template Engine for an alternative to using Jade mixing with IE conditional comments.
I hope this helps.
source share