Skip to content

createEditor

createEditor<T>(container?, options?, …extensions?): PrismEditor<T>

Defined in: core.ts:23

Creates a code editor using the specified container and options.

T extends object = { }

Element to append the editor to or a selector. This can also be a ShadowRoot or DocumentFragment for example. If omitted, you must manually append editor.container to the DOM.

string | ParentNode | null

Options the editor is initialized with. If omitted, the editor won’t function until you call editor.setOptions.

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

EditorExtension<T>[]

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

PrismEditor<T>

Object to interact with the created editor.