mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Improve plain text comparison in data snapshot https://github.com/siyuan-note/siyuan/issues/13046
This commit is contained in:
parent
fb3bc9aa81
commit
f9f16cd3bb
2 changed files with 4 additions and 2 deletions
|
|
@ -151,8 +151,7 @@ func OpenRepoSnapshotDoc(fileID string) (title, content string, displayInText bo
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
displayInText = true
|
displayInText = true
|
||||||
title = path.Base(file.Path)
|
title = file.Path
|
||||||
|
|
||||||
if mimeType := mime.TypeByExtension(filepath.Ext(file.Path)); strings.HasPrefix(mimeType, "text/") || strings.Contains(mimeType, "json") {
|
if mimeType := mime.TypeByExtension(filepath.Ext(file.Path)); strings.HasPrefix(mimeType, "text/") || strings.Contains(mimeType, "json") {
|
||||||
// 如果是文本文件,直接返回文本内容
|
// 如果是文本文件,直接返回文本内容
|
||||||
// All plain text formats are supported when comparing data snapshots https://github.com/siyuan-note/siyuan/issues/12975
|
// All plain text formats are supported when comparing data snapshots https://github.com/siyuan-note/siyuan/issues/12975
|
||||||
|
|
|
||||||
|
|
@ -433,6 +433,9 @@ func initMime() {
|
||||||
|
|
||||||
// 文档数据文件
|
// 文档数据文件
|
||||||
mime.AddExtensionType(".sy", "application/json")
|
mime.AddExtensionType(".sy", "application/json")
|
||||||
|
|
||||||
|
mime.AddExtensionType(".md", "text/markdown")
|
||||||
|
mime.AddExtensionType(".markdown", "text/markdown")
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetDataAssetsAbsPath() (ret string) {
|
func GetDataAssetsAbsPath() (ret string) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue