Skip to content

Commit

Permalink
jog: don't recurse on untyped tables
Browse files Browse the repository at this point in the history
  • Loading branch information
tarleb committed Nov 18, 2024
1 parent 070ed4e commit 22ce9b0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/resources/filters/modules/jog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@ local function recurse (element, tp, jogger)
if leaf_node_tags[tag] then
-- do nothing, cannot traverse any deeper
elseif tp == 'table' then
for key, value in pairs(element) do
element[key] = jogger(value)
if element.long then
-- looks like a caption, so recurse into caption fields
element.long = jogger(element.long)
if element.short then
element.short = jogger(element.short)
end
else
-- do nothing, probably a custom node
end
elseif content_only_node_tags[tag] or tp == 'pandoc Cell' then
element.content = jogger(element.content)
Expand Down

0 comments on commit 22ce9b0

Please sign in to comment.