diff --git a/config.org b/config.org index 57533fd..35d51e6 100644 --- a/config.org +++ b/config.org @@ -548,6 +548,21 @@ Export external links as ~target= “_blank”~, from [[https://emacs.stackexcha 'my-org-export-add-target-blank-to-http-links) #+END_SRC +Get rid of =file://= using the same method. + +#+BEGIN_SRC emacs-lisp + (defun my-org-export-correct-file-links (text backend info) + "Add target=\"_blank\" to external links." + (when (and + (org-export-derived-backend-p backend 'html) + (string-match "href=\"file[^\"]+" text)) + (string-match "file://" text) + (replace-match "" nil nil text))) + + (add-to-list 'org-export-filter-link-functions + 'my-org-export-correct-file-links) +#+END_SRC + *** Packages **** =org-agenda-property=