Skip to content

PrismModule

Unofficial

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

Import:

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

Signature:

export interface PrismModule

Properties

PropertyTypeDescription
disableWorkerMessageHandlerboolean | undefinedWhether to disable the default Prism worker message handler.
hooksPrismHooksThe hooks registry.
languagesLanguagesThe languages registry.
manualboolean | undefinedWhether Prism should skip automatic highlighting on page load.
pluginsRecord<string, unknown>Loaded plugins.
utilPrismUtilUtility functions.

Methods

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

Links to this page: