Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve Markdown code block parsing https://github.com/siyuan-note/siyuan/issues/13552

Danieldbb5bcccb1b2
diff --git a/app/src/protyle/util/paste.ts b/app/src/protyle/util/paste.ts
index 37309c5e98..09cca230ad 100644
--- a/app/src/protyle/util/paste.ts
+++ b/app/src/protyle/util/paste.ts
@@ -438,6 +438,10 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
// 复制 HTML 块粘贴出来的不是 HTML 块 https://github.com/siyuan-note/siyuan/issues/12994
tempInnerHTML = Lute.UnEscapeHTMLStr(tempInnerHTML);
}
+
+ // https://github.com/siyuan-note/siyuan/issues/13552
+ tempInnerHTML = tempInnerHTML.replace(/\u200D```/g, "```");
+
insertHTML(tempInnerHTML, protyle, isBlock, false, true);
}
filterClipboardHint(protyle, protyle.lute.BlockDOM2StdMd(tempInnerHTML));