mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 01:50:12 +01:00
🎨 导入 Markdown 时支持图片路径包含空格 Fix https://github.com/siyuan-note/siyuan/issues/6688
This commit is contained in:
parent
70e144d72a
commit
bf0b9df04f
2 changed files with 12 additions and 2 deletions
|
|
@ -518,7 +518,14 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
|
|||
return ast.WalkContinue
|
||||
}
|
||||
|
||||
if !util.IsRelativePath(dest) || "" == dest {
|
||||
dest = strings.ReplaceAll(dest, "%20", " ")
|
||||
dest = strings.ReplaceAll(dest, "%5C", "/")
|
||||
n.Tokens = []byte(dest)
|
||||
if !util.IsRelativePath(dest) {
|
||||
return ast.WalkContinue
|
||||
}
|
||||
dest = filepath.ToSlash(dest)
|
||||
if "" == dest {
|
||||
return ast.WalkContinue
|
||||
}
|
||||
|
||||
|
|
@ -611,10 +618,12 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
|
|||
return ast.WalkContinue
|
||||
}
|
||||
|
||||
dest = strings.ReplaceAll(dest, "%20", " ")
|
||||
dest = strings.ReplaceAll(dest, "%5C", "/")
|
||||
n.Tokens = []byte(dest)
|
||||
if !util.IsRelativePath(dest) {
|
||||
return ast.WalkContinue
|
||||
}
|
||||
|
||||
dest = filepath.ToSlash(dest)
|
||||
if "" == dest {
|
||||
return ast.WalkContinue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue