Function highlightText

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

    Parameters

    • text: string

      A string with the code to be highlighted.

    • ref: string | Grammar

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

    Returns string

Generated using TypeDoc