documentcloud / jammit

Industrial Strength Asset Packaging for Rails
http://documentcloud.github.com/jammit/
MIT License
1.16k stars 197 forks source link

Fixed compile_jst function to support crlf on windows (thanx to jashkenas) #129

Closed fe9lix closed 13 years ago

fe9lix commented 13 years ago

The compile_jst function now replaces crlf in (\r\n) in JST templates. This fixes an issue where the function would render line breaks within the template string on windows (resulting in invalid JS).

nesizer commented 13 years ago

i have just tested this on a windows 7 machine with a file saved with crlf endings and it works

fe9lix commented 13 years ago

You mean before or after the bugfix? ;) I'm also on Windows 7 and testing locally...it only works with this fix, i.e. after removing all crlfs. Otherwise, if you view the source in Firebug, you have all these line breaks in the template string which render the JavaScript invalid.

nesizer commented 13 years ago

After the bugfix. Sorry for not being specific about that

fe9lix commented 13 years ago

Ok, cool, so I think they should pull it into master soon :)

aaronchi commented 13 years ago

+1 Took me forever to figure out what was going on

jashkenas commented 13 years ago

Thanks for the fix -- it's merged to master, and will go out with the next release.

ses4j commented 10 years ago

I seem to be having Windows line-ending issues on Jammit 0.6.6, I can see double-line endings in Windows-style js my yui temporary merged file.

ses4j commented 10 years ago

Specifically, my input files have CRLF, and the temporary file that YUI is balking on trying to compress has CRCRLF in it.