Skip to content

PrismModule

Unofficial

The Prism.js library module type, representing the window.Prism object.

Import:

import type { PrismModule } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface PrismModule

Properties

Property Type Description
disableWorkerMessageHandler boolean | undefined Whether to disable the default Prism worker message handler.
hooks PrismHooks The hooks registry.
languages Languages The languages registry.
manual boolean | undefined Whether Prism should skip automatic highlighting on page load.
plugins Record<string, unknown> Loaded plugins.
util PrismUtil Utility functions.

Methods

Method Returns Description
highlight(text, grammar, language) string Highlights text using a grammar.
highlightAll(async?, callback?) void Highlights all code elements on the page.
highlightAllUnder(container, async?, callback?) void Highlights all code elements under a container.
highlightElement(element, async?, callback?) void Highlights a single element.
tokenize(text, grammar) Array<PrismToken | string> Tokenizes text using a grammar.

Links to this page: