From e4e513faf0753d4ffc1e5cb0d6162c58e1686fef Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sun, 22 Mar 2026 01:46:54 -0500 Subject: [PATCH] Add once-useful lua script Signed-off-by: Danila Fedorin --- content/blog/music_theory/svg-inline.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 content/blog/music_theory/svg-inline.lua diff --git a/content/blog/music_theory/svg-inline.lua b/content/blog/music_theory/svg-inline.lua new file mode 100644 index 0000000..fe5aaf9 --- /dev/null +++ b/content/blog/music_theory/svg-inline.lua @@ -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