Skip to content

Commit

Permalink
Update dot graph generator
Browse files Browse the repository at this point in the history
  • Loading branch information
bewuethr committed Aug 7, 2023
1 parent 26e7868 commit aa72aa8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pandoc/dotgraph.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function createDotGraph(elem)
end

local imgObj = getImgObj(elem, fname)
retList:extend({pandoc.Para{imgObj}})
retList:extend({imgObj})

return retList
end
Expand All @@ -53,11 +53,12 @@ end

-- Return a pandoc image object
function getImgObj(elem, fname)
local img = pandoc.Image(elem.attributes.caption or "", fname)

if not elem.attributes.caption then
return pandoc.Image("", fname)
return pandoc.Plain{img}
end

-- Trigger a full-blown figure
local enableCaption = "fig:"
return pandoc.Image(elem.attributes.caption, fname, enableCaption)
-- Return a full-blown figure
return pandoc.Figure(pandoc.Plain{img}, {elem.attributes.caption})
end

0 comments on commit aa72aa8

Please sign in to comment.