Skip to content

Commit

Permalink
latex: be more robust in the presence of weird float content
Browse files Browse the repository at this point in the history
  • Loading branch information
cscheid committed Dec 19, 2023
1 parent 9243d6e commit ee6d2b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/resources/filters/customnodes/floatreftarget.lua
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,11 @@ end, function(float)
})
local pt = pandoc.utils.type(float.content)
if pt == "Block" then
if float.content.content == nil then
-- it's a block that doesn't support inner content
-- attempt a best-effort fix by replacing it with a wrapping div
float.content = pandoc.Div({float.content})
end
float.content.content:insert(1, caption_setup)
elseif pt == "Blocks" then
float.content:insert(1, caption_setup)
Expand Down

0 comments on commit ee6d2b9

Please sign in to comment.