Skip to content

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

:bug: The image does not display after pasting some PDF rectangular annotations Fix https://github.com/siyuan-note/siyuan/issues/9321

Danielfee908d01e23
diff --git a/kernel/model/upload.go b/kernel/model/upload.go
index 72fdfcc46e..d80e83b13f 100644
--- a/kernel/model/upload.go
+++ b/kernel/model/upload.go
@@ -52,13 +52,13 @@ func InsertLocalAssets(id string, assetPaths []string, isUpload bool) (succMap m
}
for _, p := range assetPaths {
- fName := filepath.Base(p)
+ baseName := filepath.Base(p)
+ fName := baseName
fName = util.FilterUploadFileName(fName)
ext := filepath.Ext(fName)
fName = strings.TrimSuffix(fName, ext)
ext = strings.ToLower(ext)
fName += ext
- baseName := fName
if gulu.File.IsDir(p) || !isUpload {
if !strings.HasPrefix(p, "\\\\") {
p = "file://" + p