From 62a059c822fa3ddf9a5ae771fe1496bdf82f32c5 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 19 Jul 2026 16:40:16 -1000 Subject: Move syntax highlighting to a Lua source filter --- source/ui-tree.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'source') diff --git a/source/ui-tree.c b/source/ui-tree.c index d3b3a30..df7e9e5 100644 --- a/source/ui-tree.c +++ b/source/ui-tree.c @@ -30,7 +30,6 @@ struct walk_tree_context { static void print_text_buffer(const char *name, char *buf, unsigned long size) { unsigned long lineno, idx; - const char *ext; const char *numberfmt = "%1$d\n"; html("\n"); @@ -68,13 +67,10 @@ static void print_text_buffer(const char *name, char *buf, unsigned long size) return; } - /* No source filter is configured, so tag the code with its file - * extension (or bare name, for Makefile and the like) and let - * cgit.js highlight it client-side. */ - ext = strrchr(name, '.'); - html("
");
+	/* No source filter is configured, so serve the text plain. Syntax
+	 * highlighting ships as an optional source filter in extensions/,
+	 * keeping language knowledge out of the core. */
+	html("
");
 	html_txt(buf);
 	html("
\n"); } -- cgit v2.8.0