Skip to content

Commit

Permalink
Support text and comment nodes as placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
FIameCaster committed Jul 9, 2024
1 parent c4aebcf commit aae5ebd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions package/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,13 @@ const createEditor = (
* element, the editor replaces it.
*
* The `textContent` of the placeholder will be the code in the editor unless `options.value` is defined.
* @param placeholder Element or selector which will be replaced by the editor.
* @param placeholder Node or selector which will be replaced by the editor.
* @param options Options the editor is initialized with.
* @param extensions Extensions added before the first render. You can still add extensions later.
* @returns Object to interact with the created editor.
*/
const editorFromPlaceholder = (
placeholder: string | HTMLElement,
placeholder: string | ChildNode,
options: Partial<EditorOptions>,
...extensions: EditorExtension[]
) => {
Expand Down Expand Up @@ -305,7 +305,7 @@ const addTextareaListener = <T extends keyof HTMLElementEventMap>(
options?: boolean | AddEventListenerOptions,
) => editor.textarea.addEventListener(type, listener, options)

const getElement = <T extends ParentNode>(el?: T | string | null) =>
const getElement = <T extends Node>(el?: T | string | null) =>
typeof el == "string" ? document.querySelector<HTMLElement>(el) : el

const userAgent = navigator.userAgent
Expand Down

0 comments on commit aae5ebd

Please sign in to comment.