-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Hi,
I recently found an issue with the YAML parser. In some circumstances, the YAML parser removes the comments starting with a sharp character in code blocks. This problem only appears when you're configuring an array with embedded code blocks.
The code below works perfectly:
$input = <<<EOF
# Comment to be removed
content: |
# Comment to be removed
Some header
# index.html
<body>
<h1>My title</h1>
</body>
Some footer # Comment to be removed
EOF;
In the above code sample, all comments are stripped except the one in the code (# hello.html
).
But if I put this YAML code inside an YAML array (see below), all comments are stripped, even those inside a code block:
$input = <<<EOF
# Comment to be removed
-
# Comment to be removed
content: |
Some header
# index.html
<body>
<h1>My title</h1>
</body>
Some footer # Comment to be removed
EOF;
I think this is a bug we should fix before releasing 2.3.