From 93dafd1c1244d8c85205a04a21f3335d7570daa5 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 3 Sep 2022 00:17:07 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E8=B6=85=E9=93=BE=E6=8E=A5=E9=94=9A?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E4=B8=AD=20`\]`=20=E7=AC=A6=E5=8F=B7?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E6=97=B6=E6=9C=AA=E6=AD=A3=E7=A1=AE=E8=BD=AC?= =?UTF-8?q?=E4=B9=89=20https://github.com/siyuan-note/siyuan/issues/4511?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/util/editorCommonEvent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index 5a341d9c5..ac87431c8 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -718,7 +718,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { let fileText = ""; files.forEach((item) => { // 拖入文件名包含 `)` 或 `]` 的文件以 `file://` 插入后链接解析错误 https://github.com/siyuan-note/siyuan/issues/5786 - fileText += `[${path.basename(item.replace(/\]/g, "\\]").replace(/\[/g, "\\["))}](file://${item.replace(/\)/g, "\\)").replace(/\(/g, "\\(")})\n`; + fileText += `[${path.basename(item).replace(/\]/g, "\\]").replace(/\[/g, "\\[")}](file://${item.replace(/\\/g, "\\\\").replace(/\)/g, "\\)").replace(/\(/g, "\\(")})\n`; }); insertHTML(protyle.lute.SpinBlockDOM(fileText), protyle); } else {