tj/haml.js

ignore blank lines

Closed this issue · 4 comments

I often get problems with blank lines. E.g.

    %script{ src: '/public/javascripts/ttt.js' }
    %script{ src: '/public/javascripts/app.js' }
_____
    %script
      != "Match = n ........

I've put in an underscore to indicate a space. I think it should just trim blank lines.

tj commented

you can have "blank" lines as long as the indentation level is the same. we cant handle this at the tokenization layer because we need to allow arbitrary whitespace in certain filters. ps dont forget about ":javascript" which might be better suited than "%script" :)

arbitrary white space is one thing - but do we need to preserve lines that are entirely whitespace ?

tj commented

id think so, its not really relevant for code filters but the plain text filter / cdata for xml etc. When I have some time I will see if I can work it into the parser

tj commented

but ya if you replace your _____ with spaces you should be fine