pandoc / lua-filters

A collection of lua filters for pandoc
MIT License
614 stars 167 forks source link

diagram filter should transfer class and style attributes #214

Open PeterSommerlad opened 2 years ago

PeterSommerlad commented 2 years ago

I made the following addition:

        -- Now, transfer the attribute "name" from the code block to the new
        -- image block. It might gets used by the figure numbering lua filter.
        -- If the figure numbering gets not used, this additional attribute
        -- gets ignored as well.
        if block.attributes["name"] then
            imgObj.attributes["name"] = block.attributes["name"]
        end

        if block.attributes["style"] then
            imgObj.attributes["style"] = block.attributes["style"]
        end
        if block.attributes["class"] then
            imgObj.attributes["class"] = block.attributes["class"]
        end