ox-html: Always resolve external custom-id links

* lisp/ox-html.el (org-html-link): Always resolve external custom-id links.

Suggested-by: Alan Schmitt <alan.schmitt@polytechnique.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/103552>
This commit is contained in:
Nicolas Goaziou 2015-12-12 09:57:51 +01:00
parent ce4143e79d
commit 8594aed1d6
1 changed files with 11 additions and 6 deletions

View File

@ -2846,12 +2846,17 @@ INFO is a plist holding contextual information. See
;; relative to a custom-id, a headline title a name,
;; a target or a radio-target.
(let ((option (org-element-property :search-option link)))
(if (not option) raw-path
(concat raw-path
"#"
(org-publish-resolve-external-link
option
(org-element-property :path link))))))
(cond ((not option) raw-path)
;; Since HTML back-end use custom-id value as-is,
;; resolving is them is trivial.
((eq (string-to-char option) ?#)
(concat raw-path "#" option))
(t
(concat raw-path
"#"
(org-publish-resolve-external-link
option
(org-element-property :path link)))))))
(t raw-path)))
;; Extract attributes from parent's paragraph. HACK: Only do
;; this for the first link in parent (inner image link for