The following code dumps invalid YAML:
console.log(yaml.safeDump({ str: '\n a\nb' }))
Invalid output due to indentation:
Leading spaces are handled in general by an indentation indicator (below), but leading newlines seem to thwart this (above):
console.log(yaml.safeDump({ str: ' a\nb' }))
Valid output:
The results above are from version 3.11.0.
The following code dumps invalid YAML:
Invalid output due to indentation:
Leading spaces are handled in general by an indentation indicator (below), but leading newlines seem to thwart this (above):
Valid output:
The results above are from version 3.11.0.