From 68679fa90a3b0494e7d09a8c98c3d6f8e8691751 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 9 Mar 2023 21:49:05 +0800 Subject: [PATCH] :art: AI --- app/src/ai/actions.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/ai/actions.ts b/app/src/ai/actions.ts index 5dcf74ced..4264f013e 100644 --- a/app/src/ai/actions.ts +++ b/app/src/ai/actions.ts @@ -4,9 +4,10 @@ import {focusByRange, setLastNodeRange} from "../protyle/util/selection"; import {insertHTML} from "../protyle/util/insertHTML"; import {Dialog} from "../dialog"; import {isMobile} from "../util/functions"; +import {getContenteditableElement} from "../protyle/wysiwyg/getBlock"; export const fillContent = (protyle:IProtyle, data:string, elements:Element[]) => { - setLastNodeRange(elements[elements.length - 1], protyle.toolbar.range); + setLastNodeRange(getContenteditableElement(elements[elements.length - 1]), protyle.toolbar.range); protyle.toolbar.range.collapse(true); insertHTML(data, protyle, true, true); }