gulp-community / gulp-haml

gulp plugin for Haml
MIT License
25 stars 20 forks source link

Compilation auto closes blocks without contents #13

Closed czipperz closed 9 years ago

czipperz commented 9 years ago

If I have an haml file of:

%html
    %body
        #content
            blah

It will compile to

blah
stephenlacy commented 9 years ago

Not related to this project. Open on the compiler that you are using.

Either https://github.com/tj/haml.js or https://github.com/creationix/haml-js

czipperz commented 9 years ago

I understand but when I use either it compiles the same way, leading me to believe that it is your problem. Could you try compiling on your own computer?

stephenlacy commented 9 years ago

This only renders, it does not alter or modify any data. https://github.com/stevelacy/gulp-haml/blob/master/index.js#L23

That line:

 %html %body #content blah 

Compiles to:

<html><body><div id="content">blah</div></body></html>

On my system.

Since both compilers are producing the same result for you, then there is an issue with your file, or encoding.

czipperz commented 9 years ago

Ok. Will do. What's your gulp file and plugins.json file? I could be going something wrong

stephenlacy commented 9 years ago

https://github.com/stevelacy/gulp-haml/blob/master/examples/gulpfile.js

czipperz commented 9 years ago

What does use strict do https://github.com/stevelacy/gulp-haml/blob/master/examples/gulpfile.js#L1

stephenlacy commented 9 years ago

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode