Yaml filter strips comments in some cases
Issue #967
resolved
In many cases, we correctly preserve comments, but in this one, we do not:
map:
- value1: "hello"
value2: goodbye
# this is a comment
We originally noticed this when processing the YAML header in a markdown file.
Comments (3)
-
-
A related pull request #426 was opened.
-
- changed status to resolved
The pull request #426 was merged.
- Log in to comment
@Chase Tingley , it looks like the problem scope can be refined a bit. Please consider the following snippets:
and
# a true comment
text is ignored as a part of a plain scalar.And according to the current specification (1.1), the plain scalars must not contain the “
:
” and “#
” character sequences as these combinations cause ambiguity with key: value pairs and comments. So, parsing behaviour in such cases can be really implementation-specific…