From fba4141e2728becd3345be5e96918ff70ff8f8ae Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 31 Mar 2023 10:36:50 +0800 Subject: [PATCH] :bug: Related PDF annotation information is not exported when exporting .sy.zip Fix https://github.com/siyuan-note/siyuan/issues/7836 --- kernel/model/export.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kernel/model/export.go b/kernel/model/export.go index 5d5e1f9b9..7ae9a4023 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) } }