From 5756fa2f6aa1c8842209dacb1639e4cbfa79a2da Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 1 Aug 2026 23:00:00 -1000 Subject: Trim the lua headers and fix the Scintillua notes --- custom/extensions/about-render.lua | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'custom/extensions/about-render.lua') diff --git a/custom/extensions/about-render.lua b/custom/extensions/about-render.lua index 073b531..c4c1c93 100644 --- a/custom/extensions/about-render.lua +++ b/custom/extensions/about-render.lua @@ -66,8 +66,6 @@ local ok_lpeg, lpeg = pcall(require, "lpeg") --- ===== configuration =================================================== - -- Readmes larger than this are served as escaped plain text rather than parsed. local max_bytes = 512 * 1024 @@ -78,8 +76,6 @@ local max_depth = 24 local filename, chunks = "", {} --- ===== helpers ========================================================= - local function trim(s) return (s:gsub("^%s+", ""):gsub("%s+$", "")) end @@ -135,7 +131,6 @@ local function safe_url(url) end --- ===== emit ============================================================ -- html, html_txt and html_attr are injected by cgit's lua filter host. Tag -- scaffolding is a literal argument to html; every value that came from the -- repository goes through html_txt, html_attr or safe_url. @@ -226,8 +221,6 @@ emit_blocks = function(blocks) end --- ===== plain text ====================================================== - local function render_plaintext(text) html("
")
 	html_txt(text)
@@ -235,7 +228,6 @@ local function render_plaintext(text)
 end
 
 
--- ===== markdown and man ================================================
 -- Both are parsed with lpeg into the block/inline node trees emit_blocks and
 -- emit_inline above consume. Parsing is pure and builds a tree; emit is the
 -- only step that writes output, so a parse failure falls back to plain text
@@ -250,7 +242,6 @@ if ok_lpeg then
 	local ws = S(" \t\r\n\f\v")
 	local eol = P(-1)
 
-	-- ----- markdown inline -----
 	local marker = S("`![*_")
 	local urlchar = 1 - S(")") - ws
 	-- Bound the link and image inner scans. Without a cap a readme of unclosed
@@ -293,7 +284,6 @@ if ok_lpeg then
 		return nodes
 	end
 
-	-- ----- markdown blocks -----
 	-- Line matchers. Each is anchored at the start of a single line and returns
 	-- its captures, or nil when the line is not of that kind.
 	local langchar = R("az", "AZ", "09") + S("_.+#-")
@@ -415,7 +405,6 @@ if ok_lpeg then
 		html("")
 	end
 
-	-- ----- man pages -----
 	-- Macro lines are matched with lpeg, and the roff inline font and character
 	-- escapes are an lpeg grammar producing a flat token list that a fold turns
 	-- into the same inline nodes markdown emits. Bold and italic are the current
@@ -560,8 +549,6 @@ else
 end
 
 
--- ===== dispatch ========================================================
-
 local handlers = {}
 for _, ext in ipairs({ "md", "markdown", "mkd", "mdown" }) do
 	handlers[ext] = render_markdown
-- 
cgit v2.8.0