Type alias DangerouslyHighlightCode

DangerouslyHighlightCode: ((code, language) => string)

This function is mostly used if you'd like to be able to have the code highlighted via dangerouslySetInnerHTML so that the code can be highlighted in node environments.

Type declaration

    • (code, language): string
    • Parameters

      • code: string

        The raw code string to turn into an HTML string

      • language: string

        The current code language or an empty string

      Returns string

Example

PrismJS Example

<Markdown highlightCode={Prism.highlightCode} markdown={markdown} />

Returns

the html to dangerously set within a <code> tag