From 31c272fb491e01030476113a8f46ba09956300fd Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 13:18:04 -0700 Subject: Count a rule among the blocks that end a paragraph --- custom/extensions/about-render.lua | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'custom') diff --git a/custom/extensions/about-render.lua b/custom/extensions/about-render.lua index 22be8e1..956d0cb 100644 --- a/custom/extensions/about-render.lua +++ b/custom/extensions/about-render.lua @@ -508,7 +508,7 @@ if has_lpeg then -- paragraph short. local function ends_paragraph(lines, i) return lines[i]:match("^%s*$") or block_start:match(lines[i]) - or table_starts(lines, i) + or break_line:match(lines[i]) or table_starts(lines, i) end local function code_block(lines) @@ -617,10 +617,8 @@ if has_lpeg then end local item = { content } i = i + 1 - -- A wrapped line carries the item on, whatever its - -- indent, while a rule still ends the list. - while i <= n and not ends_paragraph(lines, i) - and not break_line:match(lines[i]) do + -- A wrapped line carries the item on, whatever its indent. + while i <= n and not ends_paragraph(lines, i) do item[#item + 1] = lines[i] i = i + 1 end @@ -650,8 +648,7 @@ if has_lpeg then i = i + 1 while i <= n do level = setext_line:match(lines[i]) - if level or ends_paragraph(lines, i) - or break_line:match(lines[i]) then + if level or ends_paragraph(lines, i) then break end paragraph[#paragraph + 1] = lines[i] -- cgit 2.11.1