🎨 Convert network images/assets to local
supports URL-encoded local file names https://github.com/siyuan-note/siyuan/issues/9929
This commit is contained in:
parent
5ee621fb12
commit
2d0613637e
1 changed files with 6 additions and 1 deletions
|
@ -113,7 +113,7 @@ func NetImg2LocalAssets(rootID, originalURL string) (err error) {
|
|||
u := string(dest)[7:]
|
||||
unescaped, _ := url.PathUnescape(u)
|
||||
if unescaped != u {
|
||||
// `Convert network images to local` supports URL-encoded local file names https://github.com/siyuan-note/siyuan/issues/9929
|
||||
// `Convert network images/assets to local` supports URL-encoded local file names https://github.com/siyuan-note/siyuan/issues/9929
|
||||
u = unescaped
|
||||
}
|
||||
if !gulu.File.IsExist(u) || gulu.File.IsDir(u) {
|
||||
|
@ -274,6 +274,11 @@ func NetAssets2LocalAssets(rootID string) (err error) {
|
|||
|
||||
if bytes.HasPrefix(bytes.ToLower(dest), []byte("file://")) { // 处理本地文件链接
|
||||
u := string(dest)[7:]
|
||||
unescaped, _ := url.PathUnescape(u)
|
||||
if unescaped != u {
|
||||
// `Convert network images/assets to local` supports URL-encoded local file names https://github.com/siyuan-note/siyuan/issues/9929
|
||||
u = unescaped
|
||||
}
|
||||
if !gulu.File.IsExist(u) || gulu.File.IsDir(u) {
|
||||
return ast.WalkContinue
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue