Skip to content

highlightText

const highlightText: (text, ref) => string

Defined in: prism/core.d.ts:149

High level utility that tokenizes the code using tokenizeText and then highlights the TokenStream using highlightTokens.

string

A string with the code to be highlighted.

Either a grammar object or a language name used to index languages. The resolved grammar is then used to highlight the text.

Grammar | string

string