yaml-cpp icon indicating copy to clipboard operation
yaml-cpp copied to clipboard

emitter: emit quotes for non-plain scalars

Open johncoomes opened this issue 6 months ago • 0 comments

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.

johncoomes avatar Jul 10 '25 19:07 johncoomes