From 39c8cd2ae5eadec313661227055fe6d07246ca4e Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Wed, 15 Jul 2026 11:12:30 -1000 Subject: Render README markdown in the browser cgit had no markdown support of its own, so a readme was rendered through an external python filter or not at all. Escaping the source and formatting it in cgit.js keeps the work in the browser like the blob highlighter, and the page stays readable as plain text without scripting. --- source/cgit.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/cgit.c') diff --git a/source/cgit.c b/source/cgit.c index 29b2131..8a7027c 100644 --- a/source/cgit.c +++ b/source/cgit.c @@ -201,6 +201,8 @@ static void config_cb(const char *name, const char *value) ctx.cfg.enable_tree_linenumbers = atoi(value); else if (!strcmp(name, "enable-tree-group-dirs")) ctx.cfg.enable_tree_group_dirs = atoi(value); + else if (!strcmp(name, "enable-markdown")) + ctx.cfg.enable_markdown = atoi(value); else if (!strcmp(name, "enable-git-config")) ctx.cfg.enable_git_config = atoi(value); else if (!strcmp(name, "enable-cache-list")) @@ -394,6 +396,7 @@ static void prepare_context(void) ctx.cfg.enable_http_clone = 1; ctx.cfg.enable_index_owner = 1; ctx.cfg.enable_tree_linenumbers = 1; + ctx.cfg.enable_markdown = 1; ctx.cfg.enable_git_config = 0; ctx.cfg.max_repo_count = 50; ctx.cfg.max_commit_count = 50; -- cgit v2.8.0