Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slim template engine syntax for [if lt IE 9

I use slim as view template engine http://slim-lang.com/

How would you write the following piece of code with slim?

thanks

<!--[if lt IE 9]>
        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
like image 771
denisjacquemin Avatar asked Jul 24 '11 18:07

denisjacquemin


3 Answers

It should use /!

/![if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]
like image 54
idrinkpabst Avatar answered Sep 20 '22 10:09

idrinkpabst


Looking through the documentation github-slim-template/slim I found:

IE conditional comment /[...]

/[if IE]
  p Get a better browser.

renders as

<!--[if IE]><p>Get a better browser.</p><![endif]-->

In your case you could write:

/[if lt IE 9]
  script src="http://html5shim.googlecode.com/svn/trunk/html5.js"  
like image 37
crimi Avatar answered Sep 21 '22 10:09

crimi


Looking at Slim's source code for Slim::Parser, it seems that you can do it this way, although I haven't tried.

/[if lt IE 9]
  <script src='http://html5shim.googlecode.com/svn/trunk/html5.js'></script>
like image 41
Thiago Jackiw Avatar answered Sep 23 '22 10:09

Thiago Jackiw