ox-html: Prefer custom ID over internal references for links to headlines

* lisp/ox-html.el (org-html-link): Use custom ID if present instead of
  internal reference.

Reported-by: Oleh Krehel <ohwoeowho@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/98259>
This commit is contained in:
Nicolas Goaziou 2015-06-10 13:31:16 +02:00
parent e87e5a3c62
commit b856f66892
1 changed files with 2 additions and 2 deletions

View File

@ -2801,7 +2801,6 @@ images, set it to:
(defun org-html-link (link desc info)
"Transcode a LINK object from Org to HTML.
DESC is the description part of the link, or the empty string.
INFO is a plist holding contextual information. See
`org-export-data'."
@ -2908,7 +2907,8 @@ INFO is a plist holding contextual information. See
(org-element-property :raw-link link) info))))
;; Link points to a headline.
(headline
(let ((href (org-export-get-reference destination info))
(let ((href (or (org-element-property :CUSTOM_ID destination)
(org-export-get-reference destination info)))
;; What description to use?
(desc
;; Case 1: Headline is numbered and LINK has no