lua-haml icon indicating copy to clipboard operation
lua-haml copied to clipboard

Weird nesting issue

Open randrews opened this issue 12 years ago • 1 comments

This is just bizarre. I have this Haml:

.foo
  %label
    %input
      Blah
  Text

It's rendered, incorrectly, with "Text" not being inside the .foo div.

But, this (should be equivalent) Haml is rendered totally correctly:

.foo
  %label
    %input Blah
  Text

randrews avatar Jul 05 '12 16:07 randrews

Ran into this again today. Same thing happens if a tag is inside the input:

.modal
  .modal-body
    .input-append
      %input
        %span.add-on
  .modal-footer

results in .modal-footer being a sibling of .modal instead of .modal-body. This only seems to affect input tags too for some weird reason. Doing this fixes it:

.modal
  .modal-body
    .input-append
      %input
      %span.add-on
  .modal-footer

Also, mis-indenting .modal-footer will work:

.modal
  .modal-body
    .input-append
      %input
        %span.add-on
    .modal-footer

This results in .modal-footer as a sibling of .modal, even though the Haml says otherwise. It's like inputs with stuff in them just eat a layer of indentation.

randrews avatar Jan 22 '13 22:01 randrews