mirror of
https://github.com/acaloiaro/resume
synced 2026-07-21 18:29:15 +00:00
15 lines
431 B
Lua
15 lines
431 B
Lua
-- Add target="_blank" attributes to all http links in a Pandoc document
|
|
|
|
local function add_target_blank (link)
|
|
if string.match(link.target, '^http') then -- here .target == href attribute
|
|
link.attributes.target = '_blank' -- here .target == traget attribute
|
|
end
|
|
return link
|
|
end
|
|
|
|
-- remove lines 4 and 6 to add target="_blank" to all links, not just http(s)
|
|
|
|
return {
|
|
{ Link = add_target_blank }
|
|
}
|
|
|