Emitter doesn't handle comments between the mapping value and key
YihaoOct opened this issue · comments
Yihao commented
Describe the bug
When there is a comment after a mapping key and before the value, the Emitter doesn't generate the correct YAML output.
Examples are:
Inline comment:
hello: # comment
- world
Parse it and emit it again, the output will be:
hello # this is a comment:
- world
Standalone comment:
hello:
# comment
- world
Parse it and emit it again, the output will be:
hello
# this is a comment
:
- world
To Reproduce
Checkout the branch for this PR: #811
Run and debug the two new test cases, see the broken output.