consider the following pyyaml code (try yourself):
import yaml
print yaml.dump(
{
"foo": [1, 2, 3]
},
default_flow_style=False
)
which outputs
and the comparable js-yaml counterpart (try yourself):
const yaml = require("js-yaml");
console.log(
yaml.safeDump({
foo: [1, 2, 3]
})
);
which outputs
You can see that pyyaml doesn't add spaces to lists (because - counts as indention). I know both are valid, but it would be great if we could a similar output as pyyaml (especially as this project started as some kind of fork)?
Changing this line to
writeBlockSequence(state, level - 1, state.dump, compact);
changes the behaviour so it should be possible to add a configuration setting to allow both behaviours.
consider the following
pyyamlcode (try yourself):which outputs
and the comparable
js-yamlcounterpart (try yourself):which outputs
You can see that
pyyamldoesn't add spaces to lists (because-counts as indention). I know both are valid, but it would be great if we could a similar output aspyyaml(especially as this project started as some kind of fork)?Changing this line to
changes the behaviour so it should be possible to add a configuration setting to allow both behaviours.