Add function to make https? links open in new tabs

Signed-off-by: magic_rb <richard@brezak.sk>
This commit is contained in:
magic_rb 2023-12-30 19:24:05 +01:00
parent 9311eae63f
commit 033a14fbf0
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E

View file

@ -50,6 +50,15 @@
(defvar magic_rb/asset-include (defvar magic_rb/asset-include
"\\(ttf\\|svg\\|jpg\\|gif\\|png\\|css\\|js\\|el\\|nb\\|ipynb\\|pdf\\|xml\\|woff2\\)") "\\(ttf\\|svg\\|jpg\\|gif\\|png\\|css\\|js\\|el\\|nb\\|ipynb\\|pdf\\|xml\\|woff2\\)")
(defun org-export-add-target-blank-to-http-links (text backend info)
"Add target=\"_blank\" to external links."
(when (and
(org-export-derived-backend-p backend 'html)
(string-match "href=\"https?[^\"]+" text)
(not (string-match "target=\"" text)))
(string-match "<a " text)
(replace-match "<a target=\"_blank\" " nil nil text)))
(defun org-publish-sitemap-filtered (exclude) (defun org-publish-sitemap-filtered (exclude)
"Publish sitemap filtered using EXCLUDE." "Publish sitemap filtered using EXCLUDE."
(lambda (title list) (lambda (title list)