🎨 超链接锚文本中 \]
符号渲染时未正确转义 https://github.com/siyuan-note/siyuan/issues/4511
This commit is contained in:
parent
91c3755232
commit
93dafd1c12
1 changed files with 1 additions and 1 deletions
|
@ -718,7 +718,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
let fileText = "";
|
let fileText = "";
|
||||||
files.forEach((item) => {
|
files.forEach((item) => {
|
||||||
// 拖入文件名包含 `)` 或 `]` 的文件以 `file://` 插入后链接解析错误 https://github.com/siyuan-note/siyuan/issues/5786
|
// 拖入文件名包含 `)` 或 `]` 的文件以 `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);
|
insertHTML(protyle.lute.SpinBlockDOM(fileText), protyle);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue