Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2023-05-27 18:35:02 +08:00
commit bb08d48d11
3 changed files with 11 additions and 7 deletions

View file

@ -18,6 +18,8 @@ Build Your Eternal Digital Garden
SiYuan is a privacy-first personal knowledge management system, support fine-grained block-level reference and Markdown
WYSIWYG.
Welcome to [SiYuan English Discussion Forum](https://liuyun.io) to learn more.
![feature0.png](https://b3logfile.com/file/2022/10/feature0-EHMFc7T.png)
## 🔮 Features
@ -156,9 +158,9 @@ We release insider preview before major updates, please visit [https://github.co
## 🏘️ Community
* [Issues](https://github.com/siyuan-note/siyuan/issues) Official support channels
* [Discord](https://discord.com/invite/bzfCBwMzdP) A community built by enthusiastic users
* [Awesome SiYuan](https://github.com/siyuan-note/awesome) Resources organized by enthusiastic users
* [English Discussion Forum](https://liuyun.io)
* [Discord](https://discord.com/invite/bzfCBwMzdP)
* [Awesome SiYuan](https://github.com/siyuan-note/awesome)
## 🛠️ Development Guide

View file

@ -161,9 +161,9 @@
## 🏘️ 社区
* [中文讨论区](https://ld246.com/domain/siyuan) 官方支持渠道
* [用户社区汇总](https://ld246.com/article/1640266171309) 由热心用户建立的社区
* [Awesome SiYuan](https://github.com/siyuan-note/awesome) 由热心用户整理的资源
* [中文讨论区](https://ld246.com/domain/siyuan)
* [用户社区汇总](https://ld246.com/article/1640266171309)
* [Awesome SiYuan](https://github.com/siyuan-note/awesome)
## 🛠️ 开发指南

View file

@ -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 `<div data-type="NodeCodeBlock" class="code-block" data-node-id="${Lute.NewNodeID()}"><div class="protyle-action"><span class="protyle-action--first protyle-action__language" contenteditable="false">${window.siyuan.storage[Constants.LOCAL_CODELANG]}</span><span class="fn__flex-1"></span><span class="protyle-icon protyle-icon--first protyle-action__copy"><svg><use xlink:href="#iconCopy"></use></svg></span><span class="protyle-icon protyle-icon--last protyle-action__menu"><svg><use xlink:href="#iconMore"></use></svg></span></div><div contenteditable="true" spellcheck="${window.siyuan.config.editor.spellcheck}">${code.replace(/&/g, "&amp;").replace(/</g, "&lt;")}<wbr></div><div class="protyle-attr" contenteditable="false">${Constants.ZWSP}</div></div>`;
} else {
// Paste code from IDE no longer escape `<` and `>` https://github.com/siyuan-note/siyuan/issues/8340
code = code.replace("<", "&lt;").replace('>', "&gt;");
return "`" + code + "`";
}
}