mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🐛 拖入文件名包含 ) 的文件以 file:// 插入后链接解析错误 Fix https://github.com/siyuan-note/siyuan/issues/5786
This commit is contained in:
parent
4bf5f8de10
commit
dfb47c00ff
2 changed files with 9 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import {focusBlock, focusByWbr, focusByRange} from "./selection";
|
||||
import {focusBlock, focusByRange, focusByWbr} from "./selection";
|
||||
import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName} from "./hasClosest";
|
||||
import {Constants} from "../../constants";
|
||||
import {paste} from "./paste";
|
||||
|
|
@ -719,6 +719,11 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
files.forEach((item) => {
|
||||
fileText += `[${path.basename(item)}](file://${item})\n`;
|
||||
});
|
||||
|
||||
// 拖入文件名包含 `)` 的文件以 `file://` 插入后链接解析错误 https://github.com/siyuan-note/siyuan/issues/5786
|
||||
fileText = fileText.replace(/\)/g, "\\)");
|
||||
fileText = fileText.substring(0, fileText.length - 3) + ")"
|
||||
|
||||
insertHTML(protyle.lute.SpinBlockDOM(fileText), protyle);
|
||||
} else {
|
||||
uploadLocalFiles(files, protyle);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue