js-yaml
Advanced tools
Comparing version 2.1.2 to 2.1.3
@@ -0,1 +1,7 @@ | ||
2.1.3 / 2013-10-16 | ||
------------------ | ||
- Fix wrong loading of empty block scalars. | ||
2.1.2 / 2013-10-07 | ||
@@ -2,0 +8,0 @@ ------------------ |
@@ -748,3 +748,3 @@ 'use strict'; | ||
textIndent = nodeIndent, | ||
emptyLines = -1, | ||
emptyLines = 0, | ||
atMoreIndented = false; | ||
@@ -824,14 +824,22 @@ | ||
// End of the scalar. Perform the chomping. | ||
// End of the scalar. | ||
if (lineIndent < textIndent) { | ||
if (CHOMPING_KEEP === chomping) { | ||
result += common.repeat('\n', emptyLines + 1); | ||
} else if (CHOMPING_CLIP === chomping) { | ||
result += '\n'; | ||
// Perform the chomping. | ||
switch (chomping) { | ||
case CHOMPING_KEEP: | ||
result += common.repeat('\n', emptyLines); | ||
break; | ||
case CHOMPING_CLIP: | ||
if (detectedIndent) { // i.e. only if the scalar is not empty. | ||
result += '\n'; | ||
} | ||
break; | ||
} | ||
// Break this `while` cycle and go to the funciton's epilogue. | ||
break; | ||
} | ||
detectedIndent = true; | ||
// Folded style: use fancy rules to handle line breaks. | ||
@@ -852,3 +860,5 @@ if (folding) { | ||
} else if (0 === emptyLines) { | ||
result += ' '; | ||
if (detectedIndent) { // i.e. only if we have already read some scalar content. | ||
result += ' '; | ||
} | ||
@@ -865,2 +875,3 @@ // Several line breaks - perceive as different lines. | ||
detectedIndent = true; | ||
emptyLines = 0; | ||
@@ -867,0 +878,0 @@ captureStart = position; |
{ | ||
"name" : "js-yaml", | ||
"version" : "2.1.2", | ||
"version" : "2.1.3", | ||
"description" : "YAML 1.2 parser and serializer", | ||
@@ -10,3 +10,3 @@ "keywords" : ["yaml", "parser", "serializer", "pyyaml"], | ||
"name" : "Dervus Grim", | ||
"email" : "dervus@lavabit.com" | ||
"email" : "dervus.grim@gmail.com" | ||
}, | ||
@@ -13,0 +13,0 @@ |
116760
2889