You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parser code used does not emit tokens for comments. The handlers exist only for what the parser emits by token name. This would have to pushed upstream to the libyaml authors. See line 872 of scanner.c.
Switching YAML libraries may happen in the future, at which time this issue can be addressed again. However, it may be useful to add a way to as.yaml to emit comments. The YAML parser, however, ignores them. A patch to libyaml would be required to change that.
Currently, YAML comments are always stripped by
yaml.load()
. For exampleI'm trying to programmatically update lots of yaml files, and these contain useful comments. It would be helpful to me to be able to preserve them.
?yaml.load
hints that it may be possible to specify a handler function to deal with this, but it isn't clear how exactly to go about it.Please can you either allow a way to preserve YAML comments or document the process.
The text was updated successfully, but these errors were encountered: