14 lines
303 B
Lua
14 lines
303 B
Lua
|
|
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
|