Permalink
Browse files

fix issue #22, non-unix line endings

  • Loading branch information...
1 parent 34fb092 commit 740ea0f6d81ed3e63bc6a6531e240b97a36fd4a3 @stevenharman stevenharman committed with Oct 1, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/haml.js
View
@@ -352,7 +352,7 @@ var Haml;
// If lines is a string, turn it into an array
if (typeof lines === 'string') {
- lines = lines.trim().split("\n");
+ lines = lines.trim().replace(/\n\r|\r/g, '\n').split('\n');
}
lines.forEach(function(line) {
@@ -437,7 +437,7 @@ var Haml;
buffer = [];
}
}
- js.split("\n").forEach(function (line) {
+ js.replace(/\n\r|\r/g, '\n').split('\n').forEach(function (line) {
part = line.match(/^(\".*\")(\s*\+\s*)?$/);
if (!part) {
flush();

0 comments on commit 740ea0f

Please sign in to comment.