Files
blog-static/content/blog/music_theory/svg-inline.lua

14 lines
303 B
Lua
Raw Normal View History

function Image(el)
local src = el.src
if src:match("%.svg$") then
local alt = el.caption and pandoc.utils.stringify(el.caption) or ""
local obj = string.format(
'{{< inlinesvg "%s" "%s" >}}',
src, alt
)
return pandoc.RawInline("html", obj)
else
return el
end
end