Skip to content

Commit e75f22f

Browse files
committed
fixed compile_jst function to support cr lf on windows
1 parent 45fd7dd commit e75f22f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/jammit/compressor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def compile_jst(paths)
9898
base_path = find_base_path(paths)
9999
compiled = paths.map do |path|
100100
contents = read_binary_file(path)
101-
contents = contents.gsub(/\n/, '').gsub("'", '\\\\\'')
101+
contents = contents.gsub(/\r?\n/, '').gsub("'", '\\\\\'')
102102
name = template_name(path, base_path)
103103
"#{namespace}['#{name}'] = #{Jammit.template_function}('#{contents}');"
104104
end

0 commit comments

Comments
 (0)