Skip to content
providerkit
GitHub

Highlighter

type Highlighter = (code, language) => ReactNode | PromiseLike<ReactNode>;

Defined in: react/src/markdown.tsx:36

Turns one finished code block into highlighted nodes, drawn inside its <code> element. Return them, or a promise of them. The plain code stays on screen until a promise resolves, and stays for good when it rejects, throws or returns nothing.

Parameter Type
code string
language string | undefined

ReactNode | PromiseLike<ReactNode>