Skip to content

Environment

Unofficial

Environment object passed to Prism hooks and used during highlighting.

Import:

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

Signature:

export interface Environment

Properties

PropertyTypeDescription
attributes?Record<string, string>Additional attributes for the wrapping element.
classes?string[]CSS classes applied to the token.
code?stringThe source code to highlight.
content?stringThe content of a token.
element?ElementThe target element being highlighted.
grammar?GrammarThe grammar used for tokenization.
highlightedCode?stringThe highlighted HTML code.
language?stringThe language identifier.
parent?Array<PrismToken | string>The parent token array.
selector?stringCSS selector used to find code elements.
tag?stringThe HTML tag name for the token.
tokenSequence?Array<PrismToken | string>The token sequence.
type?stringThe type of the token.