moderator-toolbox-nxg-for-reddit / modules/syntax/dom

modules/syntax/dom

Functions

createStylesheetBundle()

createStylesheetBundle(s): SyntaxBundle | null

Defined in: extension/data/modules/syntax/dom.tsx:60

Mounts a CodeMirror CSS editor on the subreddit stylesheet page.

Parameters

s

SyntaxSettings

Returns

SyntaxBundle | null

A bundle with a destroy callback, or null if the current page is not the stylesheet editor.


createWikiBundle()

createWikiBundle(s): SyntaxBundle | null

Defined in: extension/data/modules/syntax/dom.tsx:127

Mounts a CodeMirror editor on a wiki edit/create page when the page matches a configured language mapping.

Parameters

s

SyntaxSettings

Returns

SyntaxBundle | null

A bundle with a destroy callback, or null if the current page is not a recognized wiki editor.

Interfaces

SyntaxBundle

Defined in: extension/data/modules/syntax/dom.tsx:51

A mounted syntax-highlight bundle that can clean itself up when the module is unloaded.

Properties

destroy

destroy: () => void

Defined in: extension/data/modules/syntax/dom.tsx:53

Tears down the CodeMirror editor and any injected React roots.

Returns

void