Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/17818

Vanessa155b72dd5d36
diff --git a/app/src/protyle/util/processCode.ts b/app/src/protyle/util/processCode.ts
index 1582928aab..30b9b5e03c 100644
--- a/app/src/protyle/util/processCode.ts
+++ b/app/src/protyle/util/processCode.ts
@@ -25,13 +25,15 @@ export const processPasteCode = (html: string, text: string, originalTextHTML: s
tempElement.querySelector(".line-number") && tempElement.querySelector(".line-content")) {
// 网页源码
isCode = true;
- } else if (originalTextHTML.indexOf('<meta name="Generator" content="Cocoa HTML Writer">') > -1 &&
+ }
+ /* Mac 上不好识别,先统一移除代码标识 https://github.com/siyuan-note/siyuan/issues/17818
+ else if (originalTextHTML.indexOf('<meta name="Generator" content="Cocoa HTML Writer">') > -1 &&
html.indexOf('\n<p class="p1">') === 0 &&
// ChatGPT app 目前没有此标识
originalTextHTML.indexOf('<style type="text/css">\np.p1') > -1) {
// Xcode
isCode = true;
- }
+ }*/
if (isCode) {
const code = text || html;