From 14513fb1be747f55a9de9b47939ac5957afeefbc Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Tue, 25 Oct 2022 00:37:26 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20`=E7=B2=98=E8=B4=B4=E8=BD=AC=E4=B9=89?= =?UTF-8?q?=E6=96=87=E6=9C=AC`=20=E5=A4=B1=E6=95=88=20Fix=20https://github?= =?UTF-8?q?.com/siyuan-note/siyuan/issues/6341?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/menus/protyle.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index ae09a5016..2ed8216d6 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -374,7 +374,10 @@ export const contentMenu = (protyle: IProtyle, nodeElement: Element) => { // https://github.com/siyuan-note/siyuan/issues/5446 // A\B\C\D\ // E - // task-blog-2~default~baiduj https://github.com/siyuan-note/siyuan/issues/5523 + // task-blog-2~default~baiduj 无法原义粘贴含有 `~foo~` 的文本 https://github.com/siyuan-note/siyuan/issues/5523 + + // 这里必须多加一个反斜杆,因为 Lute 在进行 Markdown 嵌套节点转换平铺标记节点时会剔除 Backslash 节点, + // 多加入的一个反斜杆会作为文本节点保留下来,后续 Spin 时刚好用于转义标记符 https://github.com/siyuan-note/siyuan/issues/6341 clipText = clipText.replace(/\\/g, "\\\\\\\\") .replace(/\*/g, "\\\\\\*") .replace(/\_/g, "\\\\\\_")