Add once-useful lua script
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
13
content/blog/music_theory/svg-inline.lua
Normal file
13
content/blog/music_theory/svg-inline.lua
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
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
|
||||||
Reference in New Issue
Block a user