Permalink
Browse files

Added windows newline support

  • Loading branch information...
1 parent 8702385 commit 127c29f61a111a0a574ce5fb0f1d8e2cbb411607 @jan-swiecki jan-swiecki committed Sep 18, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/yaml.js
View
@@ -68,6 +68,10 @@ exports.tokenize = function (str) {
var token, captures, ignore, input,
indents = 0, lastIndents = 0,
stack = [], indentAmount = -1
+
+ // Windows new line support (CR+LF, \r\n)
+ str = str.replace(/\r\n/g, "\n");
+
while (str.length) {
for (var i = 0, len = tokens.length; i < len; ++i)
if (captures = tokens[i][1].exec(str)) {

0 comments on commit 127c29f

Please sign in to comment.