An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: fix https://github.com/siyuan-note/siyuan/issues/8066
Vanessa8ff4fc56216e
diff --git a/app/src/protyle/util/insertHTML.ts b/app/src/protyle/util/insertHTML.tsindex adc1f1c801..b74985354d 100644--- a/app/src/protyle/util/insertHTML.ts+++ b/app/src/protyle/util/insertHTML.ts@@ -34,14 +34,19 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false,let id = blockElement.getAttribute("data-node-id");range.insertNode(document.createElement("wbr"));let oldHTML = blockElement.outerHTML;+ const isNodeCodeBlock = blockElement.getAttribute("data-type") === "NodeCodeBlock"if (!isBlock &&- (blockElement.getAttribute("data-type") === "NodeCodeBlock" || protyle.toolbar.getCurrentType(range).includes("code"))) {+ (isNodeCodeBlock || protyle.toolbar.getCurrentType(range).includes("code"))) {range.deleteContents();range.insertNode(document.createTextNode(html.replace(/\r\n|\r|\u2028|\u2029/g, "\n")));range.collapse(false);range.insertNode(document.createElement("wbr"));- getContenteditableElement(blockElement).removeAttribute("data-render");- highlightRender(blockElement);+ if (isNodeCodeBlock) {+ getContenteditableElement(blockElement).removeAttribute("data-render");+ highlightRender(blockElement);+ } else {+ focusByWbr(blockElement, range);+ }blockElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));updateTransaction(protyle, id, blockElement.outerHTML, oldHTML);setTimeout(() => {