Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
bb08d48d11
3 changed files with 11 additions and 7 deletions
|
@ -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.
|
||||
|
||||

|
||||
|
||||
## 🔮 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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
## 🛠️ 开发指南
|
||||
|
||||
|
|
|
@ -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, "&").replace(/</g, "<")}<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("<", "<").replace('>', ">");
|
||||
return "`" + code + "`";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue