From 12bf0b8e4270956cee1739520d303d9b7527a7f0 Mon Sep 17 00:00:00 2001 From: bytedream Date: Mon, 5 May 2025 23:15:22 +0200 Subject: [PATCH] Fix only text/* being viewable in web UI (#34374) Regression from #34356, files like SVGs should be editable too (https://github.com/go-gitea/gitea/pull/34356#discussion_r2072766240). --- routers/web/repo/editor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/repo/editor.go b/routers/web/repo/editor.go index 514eb0ebfe..03e5b830a0 100644 --- a/routers/web/repo/editor.go +++ b/routers/web/repo/editor.go @@ -165,7 +165,7 @@ func editFile(ctx *context.Context, isNewFile bool) { ctx.Data["FileSize"] = blob.Size() // Only some file types are editable online as text. - if !fInfo.isTextFile || fInfo.isLFSFile { + if !fInfo.st.IsRepresentableAsText() || fInfo.isLFSFile { ctx.NotFound(nil) return }