-- Based on: -- https://pandoc.org/lua-filters.html#center-images-in-latex-and-html-output -- Licensed under MIT License found at: -- https://github.com/TomBener/pandoc-templates/blob/05aba224519d8a2b037108948bde0d820860b786/LICENSE -- Filter images with this function if the target format is HTML if FORMAT:match 'html' then function Image (elem) if elem.classes[1] == 'center' then -- Use CSS style to center image elem.attributes.style = (elem.attributes.style or '') .. ';margin:auto; display: block;' end return elem end end