forked from mszep/pandoc_resume
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added lua script from pandoc discussion to convert links to new tab i…
…n html
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-- 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 } | ||
} | ||
|