Description
Return style=literal or folded and chomping=keep for +, strip for -, or clip when absent.
YAML uses context-sensitive indicators for scalar styles, indentation, tags, anchors, and document boundaries. A token may be meaningful only within the surrounding stream and indentation structure. Recognizing one header or marker is distinct from parsing a document or resolving its values.
Return style=literal or folded and chomping=keep for +, strip for -, or clip when absent.
When to use this tool
Use Yaml Block Scalar Chomping Token when you need to recognize the supported YAML marker or header token before a broader parsing step.
How to use the tool and how it works
- Enter token. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read style, chomping. Use the output convention below.
Accept | or > with an optional following + or -. Return style=literal or folded and chomping=keep for +, strip for -, or clip when absent.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| token | Complete literal token in the grammar stated above. | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| style | Style | Required. Text; maximum UTF-16 length 8192. |
| chomping | Chomping | Required. Text; maximum UTF-16 length 8192. |
{
"input": {
"token": "|-"
},
"output": {
"style": "literal",
"chomping": "strip"
}
} Limitations and assumptions
- Indentation indicators and trailing comments are not supported by this token grammar. No scalar body is parsed, folded, or chomped; the result only labels the header notation.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use a full YAML parser for stream context, indentation, aliases, tags, scalar content, and document validity. Treat the output as the stated local recognition result.
References
Similar or alternative tools
- Parsing: Yaml Block Chomp Indicator
Parse a restricted YAML block-scalar style/indent/chomping indicator token in either allowed modifier order; does not parse indentation, content or a YAML document.
- Toml Literal String Quote Count
Identify the one-quote or three-quote opening delimiter of a TOML literal string, including empty literals; this does not parse a complete TOML document.