Skip to main content
The Deno 2 Release Candidate is here
Learn more
Go to Latest
function highlightElement
import { highlightElement } from "https://deno.land/x/frugal@0.5.0/docs/dep/prism.ts";

Highlights the code inside a single element.

The following hooks will be run:

  1. before-sanity-check
  2. before-highlight
  3. All hooks of Prism.highlightElement. These hooks will only be run by the current worker if async is true.
  4. before-insert
  5. after-highlight
  6. complete

Parameters

element: Element

The element containing the code. It must have a class of language-xxxx to be processed, where xxxx is a valid language identifier.

optional
async: boolean
optional
callback: HighlightCallback