Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve net img convert to local https://github.com/siyuan-note/siyuan/issues/13600

Danield34caba3bbfe
diff --git a/kernel/api/asset.go b/kernel/api/asset.go
index f99cbfbf60..cb5bd4e557 100644
--- a/kernel/api/asset.go
+++ b/kernel/api/asset.go
@@ -57,6 +57,9 @@ func statAsset(c *gin.Context) {
if strings.Contains(p, ":") {
p = strings.TrimPrefix(p, "/")
}
+ if strings.Contains(p, "?") {
+ p = p[:strings.Index(p, "?")]
+ }
} else {
ret.Code = 1
return
diff --git a/kernel/model/assets.go b/kernel/model/assets.go
index 179c71f6f4..c89d3e54f3 100644
--- a/kernel/model/assets.go
+++ b/kernel/model/assets.go
@@ -116,6 +116,9 @@ func NetAssets2LocalAssets(rootID string, onlyImg bool, originalURL string) (err
if strings.Contains(u, ":") {
u = strings.TrimPrefix(u, "/")
}
+ if strings.Contains(u, "?") {
+ u = u[:strings.Index(u, "?")]
+ }
if !gulu.File.IsExist(u) || gulu.File.IsDir(u) {
continue