function note(el) el.classes = pandoc.List() el.classes:insert("c-note") return el end function figure(el) local images = pandoc.List() pandoc.walk_block(el, { Image = function(iel) images:insert(iel) end }) return pandoc.RawBlock("html", "
\ \ \ \
") end function Div(el) if el.classes:includes("note") then el = note(el) elseif el.classes:includes("figure") then el = figure(el) end return el end