jbeder / yaml-cpp

A YAML parser and emitter in C++
MIT License
5.09k stars 1.83k forks source link

Emitter indentation does not seem to do anything #1144

Closed eligbr closed 1 year ago

eligbr commented 1 year ago

Hi, I am trying to emit an indented YAML file using emitter::Indent(x) but I get the output all in one line. Am I doing something wrong?

I tried a workaround for now - I used nlholman::json library, I emitted the YAML double quoted to emulate a json and then dumped the json with the json library and got correct indentation, but the double quoting algorithm seems to double quote values as well which is not good...

Would appreciate any help, Thanks

jbeder commented 1 year ago

It's possible there's a bug, but it's hard to tell from this description. I'd start with a question on Stack Overflow (be sure to give more context there), and if it turns out there's a bug in yaml-cpp, please file one with enough detail!