tokenizeDataUris
tokenizeDataUris(
tokens):void
Defined in: prism/utils/data-uri.js:54
Function that will highlight the body of data URIs. If you have
'data:image/svg+xml,<svg></svg>', then this will highlight <svg></svg> as XML for
example.
Note that this function should be the first tokenization function that’s called. If
matchBrackets or matchTags are called before this function is added
as a tokenize listener, then tags and brackets created by this won’t be matched
together.
With editors
Section titled “With editors”To use this function with editors, add it as a tokenize listener.
createEditor( "#editor", { ... }, editor => editor.on("tokenize", tokenizeDataUris), // Other tokenizers after matchBrackets())With code blocks
Section titled “With code blocks”To use this function with code blocks, call it inside tokenizeCallback.
renderCodeBlock({ language: "js", code: "const foo = 'bar'", tokenizeCallback(tokens) { tokenizeDataUris(tokens)
// Other tokenizers after }})Parameters
Section titled “Parameters”tokens
Section titled “tokens”Tokens to mutate.
Returns
Section titled “Returns”void