Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Haml Elements on Same Line

Tags:

haml

I want to be able to have two Haml elements on the same line. For example:

%h1 %a{:href => '/'} Professio.

That doesn't work. How would I get something like this to work without borking?

like image 257
Ethan Turkeltaub Avatar asked Mar 13 '10 03:03

Ethan Turkeltaub


1 Answers

Haml cannot do this. Slim can:

h1: a( href='/' ) Professio.

is the same as:

h1
  a( href="/ ) Professio

You can write as deeper tree as you need:

ul.nav
  li.active: a( href="/home" ):    strong Home
  li:        a( href="/contact" ): span   Contact

Jade also has similar syntax and support this feature, but it's been designed for Node.js environment.

like image 52
a.s.panchenko Avatar answered Oct 21 '22 07:10

a.s.panchenko