From 989201c75add498c2ee4c1039dc0e63baa0f0af7 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 13:17:21 -0700 Subject: Inline the list check before indented code --- custom/extensions/about-render.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'custom') diff --git a/custom/extensions/about-render.lua b/custom/extensions/about-render.lua index 5889e97..22be8e1 100644 --- a/custom/extensions/about-render.lua +++ b/custom/extensions/about-render.lua @@ -488,11 +488,6 @@ if has_lpeg then local function ordered(mark) return mark:match("%d") ~= nil end - local function follows_list(blocks) - local last = blocks[#blocks] - return last ~= nil and last.kind == "list" - end - -- An indented block runs on through blank lines, and up to four spaces -- or one tab come off each of its lines. local function continues_code(line) @@ -639,7 +634,8 @@ if has_lpeg then -- Four spaces or a tab start a code block, except straight -- after a list, where an indented paragraph more likely -- carries an item on. - elseif code_indent:match(line) and not follows_list(blocks) then + elseif code_indent:match(line) + and (blocks[#blocks] or {}).kind ~= "list" then local code = {} while i <= n and continues_code(lines[i]) do code[#code + 1] = unindent(lines[i]) -- cgit