🎨 All plain text formats are supported when comparing data snapshots https://github.com/siyuan-note/siyuan/issues/12975

This commit is contained in:
Daniel 2024-11-01 09:38:34 +08:00
parent 641550e1ed
commit 6db7b847e9
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
5 changed files with 19 additions and 37 deletions

View file

@ -20,7 +20,6 @@ import (
"bytes"
"io"
"io/fs"
"mime"
"os"
"path"
"path/filepath"
@ -30,7 +29,6 @@ import (
"github.com/88250/gulu"
"github.com/88250/lute/ast"
"github.com/gabriel-vasile/mimetype"
"github.com/siyuan-note/filelock"
"github.com/siyuan-note/logging"
)
@ -75,21 +73,6 @@ func GetUniqueFilename(filePath string) string {
}
}
func GetMimeTypeByExt(filePath string) (ret string) {
ret = mime.TypeByExtension(filepath.Ext(filePath))
if "" == ret {
m, err := mimetype.DetectFile(filePath)
if err != nil {
logging.LogErrorf("detect mime type of [%s] failed: %s", filePath, err)
return
}
if nil != m {
ret = m.String()
}
}
return
}
func IsSymlinkPath(absPath string) bool {
fi, err := os.Lstat(absPath)
if err != nil {