No newlines in explicit flow maps for ypsMinimal

This commit is contained in:
Felix Krause 2016-01-11 20:58:24 +01:00
parent fc9607f959
commit 2d4746b56c
1 changed files with 5 additions and 3 deletions

View File

@ -62,6 +62,7 @@ proc startItem(target: Stream, style: YamlPresentationStyle, indentation: int,
target.write(": ") target.write(": ")
state = dBlockMapValue state = dBlockMapValue
of dFlowExplicitMapKey: of dFlowExplicitMapKey:
if style != ypsMinimal:
target.write('\x0A') target.write('\x0A')
target.write(repeat(' ', indentation)) target.write(repeat(' ', indentation))
target.write(": ") target.write(": ")
@ -76,7 +77,8 @@ proc startItem(target: Stream, style: YamlPresentationStyle, indentation: int,
target.write(", ") target.write(", ")
state = dFlowImplicitMapKey state = dFlowImplicitMapKey
of dFlowMapStart: of dFlowMapStart:
if isObject or style in [ypsJson, ypsCanonical]: if (isObject and style != ypsMinimal) or
style in [ypsJson, ypsCanonical]:
target.write("\x0A" & repeat(' ', indentation)) target.write("\x0A" & repeat(' ', indentation))
if style != ypsJson: if style != ypsJson:
target.write("? ") target.write("? ")