From 033a14fbf04fda6b9a6b965d24f0050fa9918250 Mon Sep 17 00:00:00 2001 From: magic_rb Date: Sat, 30 Dec 2023 19:24:05 +0100 Subject: [PATCH] Add function to make https? links open in new tabs Signed-off-by: magic_rb --- make.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/make.el b/make.el index 7eb953c..c803472 100644 --- a/make.el +++ b/make.el @@ -50,6 +50,15 @@ (defvar magic_rb/asset-include "\\(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 "