diff options
Diffstat (limited to 'custom/extensions/about-render.lua')
-rw-r--r--custom/extensions/about-render.lua28
1 file changed, 20 insertions, 8 deletions
diff --git a/custom/extensions/about-render.lua b/custom/extensions/about-render.lua
index ed7e340..cc0892f 100644
--- a/custom/extensions/about-render.lua
+++ b/custom/extensions/about-render.lua
@@ -201,6 +201,15 @@ local function shows_something(lines)
return false
end
+local function emit_lines(lines)
+ for i, line in ipairs(lines) do
+ if i > 1 then
+ html("\n")
+ end
+ emit_inline(line)
+ end
+end
+
local emit_blocks
emit_blocks = function(blocks)
@@ -249,18 +258,13 @@ emit_blocks = function(blocks)
html("<" .. tag .. ">")
for _, item in ipairs(block.items) do
html("<li>")
- emit_inline(item)
+ emit_lines(item)
html("</li>")
end
html("</" .. tag .. ">")
elseif kind == "para" and shows_something(block.lines) then
html("<p>")
- for i, line in ipairs(block.lines) do
- if i > 1 then
- html("\n")
- end
- emit_inline(line)
- end
+ emit_lines(block.lines)
html("</p>")
end
end
@@ -496,8 +500,16 @@ if has_lpeg then
if not item_mark or ordered(item_mark) ~= is_ordered then
break
end
- items[#items + 1] = parse_inline(content)
+ 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
+ item[#item + 1] = lines[i]
+ i = i + 1
+ end
+ items[#items + 1] = paragraph_lines(item)
end
blocks[#blocks + 1] = {
kind = "list",