yaml-cpp
yaml-cpp copied to clipboard
emitter: emit quotes for non-plain scalars
Use the "!" tag to detect scalars that are not plain scalars and pass EMITTER_MANIP::DoubleQuoted to Emitter::Write() to ensure they are quoted.
This preserves quotes on quoted items that do not strictly need quotes. The alternative of detecting and quoting only the values that need quotes seemed error-prone and brittle.
Fixes #1362.