Sounds like you are using a specialized parser. At that point, it’s not YAML.
Per the YAML docs [0], "Creating a fully compliant parser has proven almost impossible." Pretty much every YAML parser out there is going to have its own idiosyncratic subset that it handles. That doesn't make the _files_ not-YAML.
(This does make YAML a horrible data exchange format. No argument there!)
Also, JSON has a similar condition [1].
[0]: https://github.com/yaml/yaml-grammar [1]: http://seriot.ch/projects/parsing_json.html