How are you importing the YAML? The issue here is not that the data is being written incorrectly (you have the literals properly represented in the in-memory string) but that whatever is doing your data import is not doing the necessary character unescaping. You could fix this as
choroba recommends with a regex post-fix, but this should really be handled in your serialization/deserialization layer.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.