summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-11-26 10:57:02 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-11-26 10:57:02 +0100
commit18f6610b324aeddb03d94a77355177a8c2cff9bb (patch)
tree919aa40603bb8a303fa940ce1211feaec5ac750d
parent63f6e851bcecfe8de50782e75f173211445a49a3 (diff)
downloadorg-mode-18f6610b324aeddb03d94a77355177a8c2cff9bb.tar.gz
ox-html: Fix last commit
* lisp/ox-html.el (org-html-link): Fix last commit.
-rw-r--r--lisp/ox-html.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 3f8dac6..5288797 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2953,10 +2953,7 @@ images, set it to:
DESC is the description part of the link, or the empty string.
INFO is a plist holding contextual information. See
`org-export-data'."
- (let* ((home (when (plist-get info :html-link-home)
- (org-trim (plist-get info :html-link-home))))
- (use-abs-url (plist-get info :html-link-use-abs-url))
- (link-org-files-as-html-maybe
+ (let* ((link-org-files-as-html-maybe
(lambda (raw-path info)
;; Treat links to `file.org' as links to `file.html', if
;; needed. See `org-html-link-org-files-as-html'.
@@ -2984,8 +2981,13 @@ INFO is a plist holding contextual information. See
(org-publish-file-relative-name raw-path info)))
;; Possibly append `:html-link-home' to relative file
;; name.
- (unless (file-name-absolute-p raw-path)
- (setq raw-path (concat (file-name-as-directory home) raw-path)))
+ (let ((home (and (plist-get info :html-link-home)
+ (org-trim (plist-get info :html-link-home)))))
+ (when (and home
+ (plist-get info :html-link-use-abs-url)
+ (file-name-absolute-p raw-path))
+ (setq raw-path (concat (file-name-as-directory home) raw-path))))
+ ;; Maybe turn ".org" into ".html".
(setq raw-path (funcall link-org-files-as-html-maybe raw-path info))
;; Add search option, if any. A search option can be
;; relative to a custom-id, a headline title, a name or