diff --git a/app/src/protyle/util/processCode.ts b/app/src/protyle/util/processCode.ts index 3c2622535..31203b4e3 100644 --- a/app/src/protyle/util/processCode.ts +++ b/app/src/protyle/util/processCode.ts @@ -29,10 +29,12 @@ export const processPasteCode = (html: string, text: string) => { } if (isCode) { - const code = text || html; + let code = text || html; if (/\n/.test(code)) { return `
${window.siyuan.storage[Constants.LOCAL_CODELANG]}
${code.replace(/&/g, "&").replace(/
${Constants.ZWSP}
`; } else { + // Paste code from IDE no longer escape `<` and `>` https://github.com/siyuan-note/siyuan/issues/8340 + code = code.replace("<", "<").replace('>', ">"); return "`" + code + "`"; } }