mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
🎨 Improve net assets to local assets https://github.com/siyuan-note/siyuan/issues/11885
This commit is contained in:
parent
d99931b71a
commit
3073be676d
2 changed files with 11 additions and 0 deletions
|
@ -125,6 +125,10 @@ func NetImg2LocalAssets(rootID, originalURL string) (err error) {
|
|||
// `Convert network images/assets to local` supports URL-encoded local file names https://github.com/siyuan-note/siyuan/issues/9929
|
||||
u = unescaped
|
||||
}
|
||||
if strings.Contains(u, ":") {
|
||||
u = strings.TrimPrefix(u, "/")
|
||||
}
|
||||
|
||||
if !gulu.File.IsExist(u) || gulu.File.IsDir(u) {
|
||||
return ast.WalkSkipChildren
|
||||
}
|
||||
|
@ -299,6 +303,10 @@ func NetAssets2LocalAssets(rootID string) (err error) {
|
|||
// `Convert network images/assets to local` supports URL-encoded local file names https://github.com/siyuan-note/siyuan/issues/9929
|
||||
u = unescaped
|
||||
}
|
||||
if strings.Contains(u, ":") {
|
||||
u = strings.TrimPrefix(u, "/")
|
||||
}
|
||||
|
||||
if !gulu.File.IsExist(u) || gulu.File.IsDir(u) {
|
||||
return ast.WalkContinue
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue