summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorEarl Warren <earl-warren@noreply.codeberg.org>2024-03-30 23:21:14 +0100
committerEarl Warren <earl-warren@noreply.codeberg.org>2024-03-30 23:21:14 +0100
commite0421b28bf0dfc87cb42ddc4e39112dd913fa029 (patch)
tree3a534fc323737e160308a47650fc7a3d618795ad /modules
parentMerge pull request 'Fix accessibility and translatability of repo explore cou... (diff)
parentFix (diff)
downloadforgejo-e0421b28bf0dfc87cb42ddc4e39112dd913fa029.tar.xz
forgejo-e0421b28bf0dfc87cb42ddc4e39112dd913fa029.zip
Merge pull request '[FEAT] Use 'Text' instead of 'Plaintext'' (#2833) from eo/forgejo:patch-1 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2833 Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Diffstat (limited to 'modules')
-rw-r--r--modules/highlight/highlight.go4
-rw-r--r--modules/highlight/highlight_test.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/highlight/highlight.go b/modules/highlight/highlight.go
index d7ab3f7afd..4ee47b7a13 100644
--- a/modules/highlight/highlight.go
+++ b/modules/highlight/highlight.go
@@ -216,8 +216,8 @@ func PlainText(code []byte) []template.HTML {
}
func formatLexerName(name string) string {
- if name == "fallback" {
- return "Plaintext"
+ if name == "fallback" || name == "plaintext" {
+ return "Text"
}
return util.ToTitleCaseNoLower(name)
diff --git a/modules/highlight/highlight_test.go b/modules/highlight/highlight_test.go
index 659688bd0f..dd15b97847 100644
--- a/modules/highlight/highlight_test.go
+++ b/modules/highlight/highlight_test.go
@@ -58,7 +58,7 @@ func TestFile(t *testing.T) {
name: "tags.txt",
code: "<>",
want: lines("&lt;&gt;"),
- lexerName: "Plaintext",
+ lexerName: "Text",
},
{
name: "tags.py",