mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
(Actually) fixed the folding newline bug, but it's a bit messy, and we don't accurately make the distinction between block folding and flow folding
This commit is contained in:
@@ -110,7 +110,7 @@ namespace YAML
|
||||
|
||||
// was this an empty line?
|
||||
bool nextEmptyLine = Exp::Break.Matches(INPUT);
|
||||
bool nextMoreIndented = (INPUT.peek() == ' ');
|
||||
bool nextMoreIndented = Exp::Blank.Matches(INPUT);
|
||||
if(params.fold && foldedNewlineCount == 0 && nextEmptyLine)
|
||||
foldedNewlineStartedMoreIndented = moreIndented;
|
||||
|
||||
@@ -125,8 +125,9 @@ namespace YAML
|
||||
scalar += "\n";
|
||||
|
||||
if(!nextEmptyLine && foldedNewlineCount > 0) {
|
||||
scalar += std::string(foldedNewlineCount - 1, '\n');
|
||||
if(foldedNewlineStartedMoreIndented || nextMoreIndented)
|
||||
scalar += std::string("\n", foldedNewlineCount);
|
||||
scalar += "\n";
|
||||
foldedNewlineCount = 0;
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user