Purely my problem for not knowing but I ran into an issue of where I needed to escape characters in a password in a yaml file. Having said that I really like yaml as a Ruby dev.
This is probably not a common piece of YAML knowledge, but it's arguably better to use "folded" style for a password:
password: >-2\n
asdjoi'";j;oj;90\[2301@
Or use single quotes, which signals to the YAML parser not to treat any characters as special, but then you need to escape the literal SINGLE QUOTE character (') by doubling it: password: 'asdjoi''";j;oj;90\[2301@'
This is completely valid yaml that reduces to the JSON equivalent: {"password": "asdjoi'\";j;oj;90\\[2301@"}
And of course you can always write JSON syntax for when the text escaping gets hairy, because YAML is a superset of JSON.Here they are together:
password1: >-2
asdjoi'";j;oj;90\[2301@
password2: 'asdjoi''";j;oj;90\[2301@'
password3: "asdjoi'\";j;oj;90\\[2301@"
See here (https://yaml-multiline.info/) for a summary of the various multi-line text styles.