You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to control indents via param options to dump? #468
@diberry could you paste your results as text instead of a screenshot? just put three backticks in one line
before and after the pasted snippet. or indent the whle snippet with 4 spaces. makes it easier to copy snippets and try them out.
@puzrin it looks like a bug to me. in the picture on the right the YAML seems invalid. items like href: ... in line 2 and expanded: ... in line 4 have no indent
@perlpunk Thanks for the pointer. @puzrin I think it is a bug - it I'm not as strict with Yaml as this library so I don't know if it is the library as a bug, the the library as intended behavior.
Activity
puzrin commentedon Feb 18, 2019
https://github.com/nodeca/js-yaml#safedump-object---options-
noArrayIndent?diberry commentedon Feb 18, 2019
Here are all my options, I toggled noArrayIndent and the results are in the screenshot. Left = original
options={ "skipInvalid":false, "noCompatMode":false, "sortKeys":false, "lineWidth":3000, "noArrayIndent":false, "noRefs":true, "flowLevel":-1, "condenseFlow":false }puzrin commentedon Feb 18, 2019
Is this this a question or not? Is this issue solved?
perlpunk commentedon Feb 18, 2019
@diberry could you paste your results as text instead of a screenshot? just put three backticks in one line
before and after the pasted snippet. or indent the whle snippet with 4 spaces. makes it easier to copy snippets and try them out.
@puzrin it looks like a bug to me. in the picture on the right the YAML seems invalid. items like
href: ...in line 2 andexpanded: ...in line 4 have no indentdiberry commentedon Feb 18, 2019
@perlpunk Thanks for the pointer.
@puzrin I think it is a bug - it I'm not as strict with Yaml as this library so I don't know if it is the library as a bug, the the library as intended behavior.
original
"noArrayIndent"= false
"noArrayIndent"=true
What I would like but not sure how to get it from .dump() - notice the same indent spacing as original.
puzrin commentedon Feb 18, 2019
That's certainly a bug, need fix. I've asked PR author. Or anyone else can do new PR.
Seems happen when root is array (rare case, missed)
diberry commentedon Feb 18, 2019
@puzrin I would like to fix and PR.
puzrin commentedon Feb 18, 2019
No problem. https://github.com/nodeca/js-yaml/pull/461/files - use this as example. If implementation will be correct, i'll approve & release asap.
Fix for issue #468 includes passing test (#469)