diff --git a/src/features/chat/ui/thread-stream/markdown-renderer.obsidian.ts b/src/features/chat/ui/thread-stream/markdown-renderer.obsidian.ts index d55b0e7c..5c148336 100644 --- a/src/features/chat/ui/thread-stream/markdown-renderer.obsidian.ts +++ b/src/features/chat/ui/thread-stream/markdown-renderer.obsidian.ts @@ -39,6 +39,7 @@ export class ThreadStreamMarkdownRenderer { const sourcePath = this.options.app.workspace.getActiveFile()?.path ?? ""; const generation = (this.renderGenerations.get(parent) ?? 0) + 1; this.renderGenerations.set(parent, generation); + // eslint-disable-next-line obsidianmd/prefer-create-el -- This detached staging node must belong to the parent's document. const staging = parent.ownerDocument.createElement("div"); void MarkdownRenderer.render(this.options.app, text, staging, sourcePath, this.options.owner).then(() => { if (!parent.isConnected || this.renderGenerations.get(parent) !== generation) return; diff --git a/src/shared/dom/textarea-autogrow.measure.ts b/src/shared/dom/textarea-autogrow.measure.ts index 381ca24d..149ec510 100644 --- a/src/shared/dom/textarea-autogrow.measure.ts +++ b/src/shared/dom/textarea-autogrow.measure.ts @@ -41,6 +41,7 @@ function textareaHeightMirror(doc: Document): HTMLTextAreaElement { const existing = textareaHeightMirrors.get(doc); if (existing?.isConnected) return existing; const staleMirrors = [...doc.querySelectorAll(`.${TEXTAREA_HEIGHT_MIRROR_CLASS}`)]; + // eslint-disable-next-line obsidianmd/prefer-create-el -- This detached mirror must belong to the measured textarea's document. const mirror = staleMirrors.shift() ?? doc.createElement("textarea"); for (const duplicate of staleMirrors) duplicate.remove(); mirror.tabIndex = -1; diff --git a/src/shared/dom/textarea-caret.measure.ts b/src/shared/dom/textarea-caret.measure.ts index c9f1d21f..0df26490 100644 --- a/src/shared/dom/textarea-caret.measure.ts +++ b/src/shared/dom/textarea-caret.measure.ts @@ -63,6 +63,7 @@ function textareaCaretTop(textarea: HTMLTextAreaElement, position: number): numb if (!window) return null; const style = window.getComputedStyle(textarea); + // eslint-disable-next-line obsidianmd/prefer-create-el -- This detached mirror must belong to the measured textarea's document. const mirror = document.createElement("div"); for (const property of textareaMirrorStyleProperties) { mirror.style[property] = style[property]; @@ -75,6 +76,7 @@ function textareaCaretTop(textarea: HTMLTextAreaElement, position: number): numb }; mirror.setCssProps(mirrorProps); + // eslint-disable-next-line obsidianmd/prefer-create-el -- This detached marker must belong to the mirror's document. const marker = document.createElement("span"); marker.textContent = "\u200b"; mirror.append(document.createTextNode(textarea.value.slice(0, position)), marker);