From a129ccc497d512b1b410e4a36e16e35a9a3e4392 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 30 Dec 2024 10:52:49 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=95=B0=E6=8D=AE=E5=BA=93=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E7=B2=98=E8=B4=B4=E5=85=89=E6=A0=87=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/util/insertHTML.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/util/insertHTML.ts b/app/src/protyle/util/insertHTML.ts index d6447647c..81a2c8140 100644 --- a/app/src/protyle/util/insertHTML.ts +++ b/app/src/protyle/util/insertHTML.ts @@ -4,7 +4,7 @@ import {transaction, updateTransaction} from "../wysiwyg/transaction"; import {getContenteditableElement} from "../wysiwyg/getBlock"; import { fixTableRange, - focusBlock, + focusBlock, focusByRange, focusByWbr, getEditorRange, getSelectionOffset, setLastNodeRange, @@ -235,8 +235,11 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement: } document.querySelector(".av__panel")?.remove(); } else if (hasClosestByClassName(range.startContainer, "av__title")) { - range.insertNode(document.createTextNode(text)); + const node = document.createTextNode(text) + range.insertNode(node); + range.setEnd(node, text.length); range.collapse(false); + focusByRange(range) updateAVName(protyle, blockElement); } });