creationix / haml-js

Haml ported to server-side Javascript. This is a traditional server-side templating language. Tested with node-js
MIT License
900 stars 109 forks source link

non-unix line endings #22

Closed stevenharman closed 14 years ago

stevenharman commented 14 years ago

Haml-js breaks when using non-unix (LF) line endings in templates. For example, if you're writing on windows you'll end up with either CR or CRLF, resulting in \r or \r\n in the template. Currently, Haml-js is splitting the templates on \n, so only the very last line of a template is evaluated.

A fix is to replace all \r or \r\n with \n BEFORE splitting.

creationix commented 14 years ago

Submit a patch and I'll take it!

stevenharman commented 14 years ago

done! http://github.com/creationix/haml-js/pull/23 :)

creationix commented 14 years ago

Thanks.