Skip to content

Commit 71fcf85

Browse files
committed
Fix ConditionalBlock crash in manuscript projects
In manuscript.lua, using pandoc.List() to build block collections and assigning to divEl.content changed the content type from "Blocks" to "List". When ConditionalBlock returned el.content, it returned a List without a .walk() method, causing crashes during AST traversal. Changed to pandoc.Blocks({}) to maintain proper type throughout the filter chain. Fixes #13616
1 parent a6e0498 commit 71fcf85

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/resources/filters/layout/manuscript.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ function manuscript()
5757
-- If this is a notebook embed cell, 'lift' the contents of any child divs
5858
-- up (unroll their contents), this will help us avoid
5959
-- labeling divs marked as `cells` more than once
60-
local blocks = pandoc.List()
60+
local blocks = pandoc.Blocks({})
6161
for _, childBlock in ipairs(divEl.content) do
6262
if is_regular_node(childBlock, "Div") then
63-
tappend(blocks, childBlock.content)
63+
blocks:extend(childBlock.content)
6464
else
6565
blocks:insert(childBlock)
6666
end

0 commit comments

Comments
 (0)