🎨 Improved PDF asset file unreferenced detection https://github.com/siyuan-note/siyuan/issues/7964

This commit is contained in:
Liang Ding 2023-04-12 12:02:56 +08:00
parent 02366f3c95
commit 204c3b469d
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 20 additions and 9 deletions

View file

@ -403,6 +403,10 @@ func ExportMarkdownHTML(id, savePath string, docx, merge bool) (name, dom string
assets := assetsLinkDestsInTree(tree)
for _, asset := range assets {
if strings.HasPrefix(asset, "assets/") {
if strings.Contains(asset, "?") {
asset = asset[:strings.LastIndex(asset, "?")]
}
srcAbsPath, err := GetAssetAbsPath(asset)
if nil != err {
logging.LogWarnf("resolve path of asset [%s] failed: %s", asset, err)