Skip to content

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

:bug: Related PDF annotation information is not exported when exporting .sy.zip Fix https://github.com/siyuan-note/siyuan/issues/7836

Liang Ding0c54c7a9397a
diff --git a/kernel/model/export.go b/kernel/model/export.go
index 5d5e1f9b9f..7ae9a40232 100644
--- a/kernel/model/export.go
+++ b/kernel/model/export.go
@@ -1357,6 +1357,16 @@ func exportSYZip(boxID, rootDirPath, baseFolderName string, docPaths []string) (
continue
}
+ if !gulu.File.IsDir(srcPath) && strings.HasSuffix(strings.ToLower(srcPath), ".pdf") {
+ sya := srcPath + ".sya"
+ if gulu.File.IsExist(sya) {
+ // Related PDF annotation information is not exported when exporting .sy.zip https://github.com/siyuan-note/siyuan/issues/7836
+ if syaErr := filelock.Copy(sya, destPath+".sya"); nil != syaErr {
+ logging.LogErrorf("copy sya from [%s] to [%s] failed: %s", sya, destPath+".sya", syaErr)
+ }
+ }
+ }
+
copiedAssets.Add(asset)
}
}