Skip to content

loadPrism

Official

Load Prism.js and return a promise to the global Prism object. Can also use Window.Prism after this promise resolves to get the same reference.

For more specific return type, use:

const Prism = await loadPrism(); ```
<ImportStatement text="import { loadPrism } from 'obsidian';" />
**Signature:**
```ts
function loadPrism(): Promise<unknown>

Returns: Promise<unknown> — A promise that resolves to the global Window.Prism object.