☁️ Loving our new documentation website? Provide feedback in the CloudCannon Community! ✨

forbidden_tokens[*]

Table of contents

Description:

This key represents an individual forbidden token string in the forbidden_tokens array.

The value is a string that specifies a token that will stop parsing content when encountered. This is useful when the content parser is being greedy and consuming more input than intended.

Appears in:
└── Snippet Format
    └── forbidden_tokens
        └── [*]
Type:
string
Examples:

In this example, we have configured a forbidden token to stop parsing when encountering a less-than sign.

Copied to clipboard
_snippets:
  highlight:
    snippet: <<highlight>> [[content]] <</highlight>>
    params:
      content:
        parser: content
        options:
          editor_key: highlighted_text
          format:
            forbidden_tokens:
              - <
{
  "_snippets": {
    "highlight": {
      "snippet": "<<highlight>> [[content]] <</highlight>>",
      "params": {
        "content": {
          "parser": "content",
          "options": {
            "editor_key": "highlighted_text",
            "format": {
              "forbidden_tokens": [
                "<"
              ]
            }
          }
        }
      }
    }
  }
}
Open in a new tab