Multiple Haml Elements on Same Line

后端 未结 4 1297
悲&欢浪女
悲&欢浪女 2020-12-16 17:00

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

4条回答
  •  无人及你
    2020-12-16 17:48

    Late answer, but I was just tackling the same problem myself and knew HAML had a way to do this as part of the language. See the White Space Removal section of the HAML reference.

    You could do it this way:

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

    Or this way:

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

提交回复
热议问题