The string "\n" (containing one character, a newline) is serialized as a block scalar:
This is very awkward to read; it would be much clearer as a double-quoted string.
Also, it breaks my syntax highlighter. While this is undoubtedly a bug with the syntax highlighter, it must be admitted that YAML is very hard to highlight correctly and that js-yaml is not making it any easier in this case. It's also worth noting that the above Markdown code block was wrong the first time I typed it because Markdown ate the significant trailing newline.
This could be fixed in the chooseScalarStyle function. I'm not sure what would be a good general rule to avoid this; I'm open to suggestions.
The string
"\n"(containing one character, a newline) is serialized as a block scalar:|+This is very awkward to read; it would be much clearer as a double-quoted string.
Also, it breaks my syntax highlighter. While this is undoubtedly a bug with the syntax highlighter, it must be admitted that YAML is very hard to highlight correctly and that js-yaml is not making it any easier in this case. It's also worth noting that the above Markdown code block was wrong the first time I typed it because Markdown ate the significant trailing newline.
This could be fixed in the
chooseScalarStylefunction. I'm not sure what would be a good general rule to avoid this; I'm open to suggestions.