Skip to content

editorFromPlaceholder

editorFromPlaceholder<T>(placeholder, options, …extensions): PrismEditor<T>

Defined in: core.ts:251

Almost identical to createEditor, but instead of appending the editor to your element, the editor replaces it.

The textContent of the placeholder will be the code in the editor unless options.value is defined.

T extends object = { }

Node or selector which will be replaced by the editor.

string | ChildNode

Partial<EditorOptions> & Omit<T, keyof EditorOptions>

Options the editor is initialized with.

EditorExtension[]

Extensions added before the first render. You can still add extensions later.

PrismEditor<T>

Object to interact with the created editor.