This key defines a parser configuration that parses rich multiline content, such as the content between paired tags. Can be configured to parse nested snippets within.
Appears in
└── Snippet
└── params
└── *
└── Content Parser ConfigurationType
Object
Properties
This key defines configuration options for content parser configurations.
The value is an object that can contain editor_key, indented_by, default, trim_text, allow_nested, raw, forbidden_tokens, optional, allow_leading, escape_indented_blocks, parse_newline_character, ignore_unpaired_backticks, escape_fenced_blocks, and style properties. These options control how content between snippet boundaries is parsed.
Appears in: Content Parser Configuration.
Show examplesHide examples
In this example, we have configured content parser options with an editor key and forbidden tokens.
_snippets:
highlight:
snippet: <<highlight>> [[content]] <</highlight>>
params:
content:
parser: content
options:
editor_key: highlighted_text
forbidden_tokens:
- <{
"_snippets": {
"highlight": {
"snippet": "<<highlight>> [[content]] <</highlight>>",
"params": {
"content": {
"parser": "content",
"options": {
"editor_key": "highlighted_text",
"forbidden_tokens": [
"<"
]
}
}
}
}
}
}This key defines the parser type for content parser configurations.
The value must be content. This specifies that the parameter uses the content parser, which parses content between snippet boundaries.
Appears in: Content Parser Configuration.
Show examplesHide examples
In this example, we have configured a content parser for a snippet parameter.
_snippets:
highlight:
snippet: <<highlight>> [[content]] <</highlight>>
params:
content:
parser: content
options:
editor_key: highlighted_text{
"_snippets": {
"highlight": {
"snippet": "<<highlight>> [[content]] <</highlight>>",
"params": {
"content": {
"parser": "content",
"options": {
"editor_key": "highlighted_text"
}
}
}
}
}
}Examples
In this example, we have configured a content parser to parse rich multiline content between paired tags.
{% highlight "js" %} let a = b; {% endhighlight %}
└──────────┘