1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Improve detecting empty files (#31332)

Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
wxiaoguang
2024-06-13 09:06:46 +08:00
committed by GitHub
parent 7115dce773
commit 47ca61d8ba
11 changed files with 29 additions and 13 deletions

View File

@@ -16,10 +16,8 @@
<div class="file-view{{if .IsMarkup}} markup {{.MarkupType}}{{else if .IsPlainText}} plain-text{{else if .IsTextFile}} code-view{{end}}">
{{if .IsFileTooLarge}}
{{template "shared/filetoolarge" dict "RawFileLink" .RawFileLink}}
{{else if .IsMarkup}}
{{if .FileContent}}{{.FileContent | SafeHTML}}{{end}}
{{else if .IsPlainText}}
<pre>{{if .FileContent}}{{.FileContent | SafeHTML}}{{end}}</pre>
{{else if not .FileSize}}
{{template "shared/fileisempty"}}
{{else if not .IsTextFile}}
<div class="view-raw">
{{if .IsImageFile}}