about summary refs log tree commit diff
path: root/preproc.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--preproc.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/preproc.lua b/preproc.lua
index 6bfa8c5..7be9a48 100644
--- a/preproc.lua
+++ b/preproc.lua
@@ -1,6 +1,13 @@
 ---@diagnostic disable: undefined-global
 -- see https://pandoc.org/lua-filters.html
 return {
+    Link = function(link)
+        -- set target="_blank" for outgoing links (open them in new tab)
+        if string.match(link.target, "gzr.im") == nil then
+            table.insert(link.attributes, { "target", "_blank" })
+        end
+        return link
+    end,
     Pandoc = function(doc)
         local front = {}