From b856f66892b8fbf827e4b4a3e89e739a9caca051 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 10 Jun 2015 13:31:16 +0200 Subject: [PATCH] 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 --- lisp/ox-html.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index d50ff5e01..4b268ff3f 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -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