Diff options
Diffstat (limited to 'custom/extensions/about-render.lua')
| -rw-r--r-- | custom/extensions/about-render.lua | 9 |
1 file changed, 8 insertions, 1 deletion
diff --git a/custom/extensions/about-render.lua b/custom/extensions/about-render.lua index 5738b00..35f30d0 100644 --- a/custom/extensions/about-render.lua +++ b/custom/extensions/about-render.lua @@ -309,7 +309,13 @@ local function emit_blocks(blocks) html("</tbody></table>") elseif kind == "list" then local tag = block.ordered and "ol" or "ul" - html("<" .. tag .. ">") + html("<" .. tag) + -- Even a blank line between two items ends a list, so the next + -- one keeps counting from the number its first item gives. + if block.ordered and block.start ~= 1 then + html(" start='" .. block.start .. "'") + end + html(">") for _, item in ipairs(block.items) do html("<li>") emit_lines(item) @@ -626,6 +632,7 @@ if has_lpeg then blocks[#blocks + 1] = { kind = "list", ordered = is_ordered, + start = is_ordered and tonumber(mark:match("%d+")), items = items, } -- Four spaces or a tab start a code block, except straight |
