🎨 Improve converting network assets to local assets https://github.com/siyuan-note/siyuan/issues/15320

This commit is contained in:
Daniel 2025-07-20 10:05:13 +08:00
parent 5d229eb589
commit 513aadb9d5
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 17 additions and 1 deletions

View file

@ -285,7 +285,7 @@ func NetAssets2LocalAssets(rootID string, onlyImg bool, originalURL string) (err
name, _ = url.PathUnescape(name)
name = util.FilterUploadFileName(name)
ext := util.Ext(name)
if "" == ext {
if !util.IsCommonExt(ext) {
if mtype := mimetype.Detect(data); nil != mtype {
ext = mtype.Extension()
name += ext