19 chars · 2 lines
Waiting for input
19 chars · 2 lines
Waiting for input
YAML block scalar header troubleshooting
The sample writes |x after message. The pipe correctly starts a literal block scalar, but x is not a valid block scalar header indicator, so parsing fails before the multiline content is read. This tool is free to use. No account or payment is required.
Last updated
Literal | and folded > scalars may use chomping and indentation indicators, but the header is not a free-form place for labels or comments. Unexpected characters are parsed as invalid syntax.
Correcting the marker lets parsing continue, but the following text still needs valid scalar indentation. Validate the whole block rather than stopping after the header error disappears.
Remove the unsupported x so the literal block begins with a valid | header.
message: |x
hellomessage: |
helloCommon questions
It starts a literal block scalar whose line breaks are preserved while indentation determines which lines belong to the value.
It starts a folded block scalar, which uses indentation for its extent and folds many internal line breaks into spaces.
Only supported block scalar indicators should appear in the header. Arbitrary suffix characters make the scalar header invalid.
Debugging a specific YAML issue? Browse YAML troubleshooting.