js-yaml
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -0,1 +1,7 @@ | ||
2.1.2 / 2013-10-07 | ||
------------------ | ||
- Fix unwanted line breaks in folded scalars. | ||
2.1.1 / 2013-10-02 | ||
@@ -2,0 +8,0 @@ ------------------ |
@@ -748,3 +748,4 @@ 'use strict'; | ||
textIndent = nodeIndent, | ||
emptyLines = -1; | ||
emptyLines = -1, | ||
atMoreIndented = false; | ||
@@ -835,18 +836,30 @@ switch (character) { | ||
// Folded style: use fancy rules to handle line breaks. | ||
if (folding) { | ||
// Lines starting with white space characters (more-indented lines) are not folded. | ||
if (CHAR_SPACE === character || CHAR_TAB === character) { | ||
atMoreIndented = true; | ||
result += common.repeat('\n', emptyLines + 1); | ||
emptyLines = 1; | ||
// End of more-indented block. | ||
} else if (atMoreIndented) { | ||
atMoreIndented = false; | ||
result += common.repeat('\n', emptyLines + 1); | ||
// Just one line break - perceive as the same line. | ||
} else if (0 === emptyLines) { | ||
result += ' '; | ||
emptyLines = 0; | ||
// Several line breaks - perceive as different lines. | ||
} else { | ||
result += common.repeat('\n', emptyLines); | ||
emptyLines = 0; | ||
} | ||
// Literal style: just add exact number of line breaks between content lines. | ||
} else { | ||
result += common.repeat('\n', emptyLines + 1); | ||
emptyLines = 0; | ||
} | ||
emptyLines = 0; | ||
captureStart = position; | ||
@@ -853,0 +866,0 @@ |
{ | ||
"name" : "js-yaml", | ||
"version" : "2.1.1", | ||
"version" : "2.1.2", | ||
"description" : "YAML 1.2 parser and serializer", | ||
@@ -5,0 +5,0 @@ "keywords" : ["yaml", "parser", "serializer", "pyyaml"], |
116375
2880