How would I format HAML to output a style similar to the conditional HTML tags used for cross-browser targeting?
%html{:class => 'no-js', :lang => 'en'}
This will produce HTML like this:
If you wanted you could use the whitespace removal syntax to make the generated HTML more like your example:
%html{:class => 'no-js', :lang => 'en'}<>
Putting it all together:
!!!
/[if lt IE 8]
/[if IE 8]
/[if IE 9]
%html{:class => 'no-js', :lang => 'en'}<>
content here
which produces:
content here
An alternative technique would be to use Haml’s surround helper:
= surround "", "" do
content here