transform.CanHighlight
Reports whether the given language is supported for syntax highlighting.
- Syntax
- transform.CanHighlight LANGUAGE
- Returns
- bool
Usage
The transform.CanHighlight function reports whether the given language is supported for syntax highlighting. The LANGUAGE argument is case-insensitive. See the list of supported languages.
If the syntax highlighter does not support a language, it renders the code without highlighting. Use this function before calling the transform.Highlight or transform.HighlightCodeBlock function to decide how to handle an unsupported language, such as by substituting a different language.
Examples
{{ transform.CanHighlight "go" }} → true
{{ transform.CanHighlight "klingon" }} → falseLast updated:
October 21, 2026
:
content: Apply style guide to transform functions (3625f720a)
Improve this page