8000 [Yaml] Allow tabs before comments at the end of a line · symfony/symfony@e27f69d · GitHub
[go: up one dir, main page]

Skip to content

Commit e27f69d

Browse files
committed
[Yaml] Allow tabs before comments at the end of a line
In Yaml 1.2 spec white space is space or tab
1 parent 6316de5 commit e27f69d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Yaml/Inline.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public static function parseScalar($scalar, $delimiters = null, $stringDelimiter
209209
$i += strlen($output);
210210

211211
// remove comments
212-
if (false !== $strpos = strpos($output, ' #')) {
212+
if ((false !== $strpos = strpos($output, '#')) && (' ' === $output[$strpos - 1] || "\t" === $output[$strpos - 1])) {
213213
$output = rtrim(substr($output, 0, $strpos));
214214
}
215215
} elseif (preg_match('/^(.+?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) {

0 commit comments

Comments
 (0)
0