Type alias DangerouslyHighlightCode

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

Type declaration

    • (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.

      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

      the html to dangerously set within a <code> tag

      Example

      PrismJS Example

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

Generated using TypeDoc