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.
Type Parameters
Section titled “Type Parameters”T
extends object
= { }
Parameters
Section titled “Parameters”placeholder
Section titled “placeholder”Node or selector which will be replaced by the editor.
string
| ChildNode
options
Section titled “options”Partial
<EditorOptions
> & Omit
<T
, keyof EditorOptions
>
Options the editor is initialized with.
extensions
Section titled “extensions”Extensions added before the first render. You can still add extensions later.
Returns
Section titled “Returns”PrismEditor
<T
>
Object to interact with the created editor.