mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-31 13:58:49 +01:00
🎨 All plain text formats are supported when comparing data snapshots https://github.com/siyuan-note/siyuan/issues/12975
This commit is contained in:
parent
fc50b864ad
commit
a2cb7d4c9b
3 changed files with 22 additions and 1 deletions
|
|
@ -153,7 +153,7 @@ func OpenRepoSnapshotDoc(fileID string) (title, content string, displayInText bo
|
|||
displayInText = true
|
||||
title = path.Base(file.Path)
|
||||
|
||||
if mimeType := mime.TypeByExtension(filepath.Ext(file.Path)); strings.HasPrefix(mimeType, "text/") {
|
||||
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
|
||||
content = gulu.Str.FromBytes(data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue