Skip to content

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

:art: Improve pasting inline code

Daniel8c52a91b4235
diff --git a/app/src/protyle/util/processCode.ts b/app/src/protyle/util/processCode.ts
index 4876be8c6b..7e66547926 100644
--- a/app/src/protyle/util/processCode.ts
+++ b/app/src/protyle/util/processCode.ts
@@ -37,7 +37,7 @@ export const processPasteCode = (html: string, text: string, originalTextHTML: s
return protyle.lute.Md2BlockDOM(code);
} else {
// Paste code from IDE no longer escape `<` and `>` https://github.com/siyuan-note/siyuan/issues/8340
- code = code.replace("<", "&lt;").replace(">", "&gt;");
+ code = code.replace(/</g, "&lt;").replace(/>/g, "&gt;");
return "`" + code + "`";
}
}