An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:bug: fix https://github.com/siyuan-note/siyuan/issues/6164
Vanessa4dfea2f9a6d7
diff --git a/app/src/protyle/util/insertHTML.ts b/app/src/protyle/util/insertHTML.tsindex 4945e33fb0..03d22bb409 100644--- a/app/src/protyle/util/insertHTML.ts+++ b/app/src/protyle/util/insertHTML.ts@@ -7,7 +7,7 @@ import {focusBlock, getEditorRange, focusByWbr, fixTableRange} from "./selectionimport {mathRender} from "../markdown/mathRender";import {Constants} from "../../constants";-export const insertHTML = (html: string, protyle: IProtyle, isBlock = false, splitSpan = true) => {+export const insertHTML = (html: string, protyle: IProtyle, isBlock = false) => {if (html === "") {return;}@@ -73,7 +73,9 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false, spl}// 粘贴带样式的行内元素到另一个行内元素中需进行切割const spanElement = range.startContainer.nodeType === 3 ? range.startContainer.parentElement: range.startContainer as HTMLElement;- if (splitSpan && spanElement.tagName === "SPAN" && spanElement.isSameNode( range.endContainer.nodeType === 3 ? range.endContainer.parentElement: range.endContainer)) {+ if (spanElement.tagName === "SPAN" && spanElement.isSameNode( range.endContainer.nodeType === 3 ? range.endContainer.parentElement: range.endContainer) &&+ tempElement.content.querySelector("span") // 粘贴纯文本不需切割 https://ld246.com/article/1665556907936+ ) {const afterElement = document.createElement("span");const attributes = spanElement.attributes;for (let i = 0; i < attributes.length; i++) {diff --git a/app/src/protyle/util/paste.ts b/app/src/protyle/util/paste.tsindex 673e279ce5..c220017910 100644--- a/app/src/protyle/util/paste.ts+++ b/app/src/protyle/util/paste.ts@@ -50,7 +50,7 @@ export const pasteAsPlainText = async (protyle:IProtyle) => {uploadLocalFiles(localFiles, protyle, false);writeText("");} else {- insertHTML(protyle.lute.BlockDOM2Content(protyle.lute.InlineMd2BlockDOM(clipboard.readText())), protyle, false, false);+ insertHTML(protyle.lute.BlockDOM2Content(protyle.lute.InlineMd2BlockDOM(clipboard.readText())), protyle, false);}/// #endif};