ox-html: Always use provided description in internal links
* lisp/ox-html.el (org-html-link): Don't skip the link description when it matches the name of the headline it targets.
This commit is contained in:
parent
bb0492d717
commit
bb30de44fd
|
@ -2521,7 +2521,7 @@ INFO is a plist holding contextual information. See
|
||||||
(type (org-element-property :type link))
|
(type (org-element-property :type link))
|
||||||
(raw-path (org-element-property :path link))
|
(raw-path (org-element-property :path link))
|
||||||
;; Ensure DESC really exists, or set it to nil.
|
;; Ensure DESC really exists, or set it to nil.
|
||||||
(desc (and (not (string= desc "")) desc))
|
(desc (org-string-nw-p desc))
|
||||||
(path
|
(path
|
||||||
(cond
|
(cond
|
||||||
((member type '("http" "https" "ftp" "mailto"))
|
((member type '("http" "https" "ftp" "mailto"))
|
||||||
|
@ -2625,12 +2625,9 @@ INFO is a plist holding contextual information. See
|
||||||
;; What description to use?
|
;; What description to use?
|
||||||
(desc
|
(desc
|
||||||
;; Case 1: Headline is numbered and LINK has no
|
;; Case 1: Headline is numbered and LINK has no
|
||||||
;; description or LINK's description matches
|
;; description. Display section number.
|
||||||
;; headline's title. Display section number.
|
|
||||||
(if (and (org-export-numbered-headline-p destination info)
|
(if (and (org-export-numbered-headline-p destination info)
|
||||||
(or (not desc)
|
(not desc))
|
||||||
(string= desc (org-element-property
|
|
||||||
:raw-value destination))))
|
|
||||||
(mapconcat 'number-to-string
|
(mapconcat 'number-to-string
|
||||||
(org-export-get-headline-number
|
(org-export-get-headline-number
|
||||||
destination info) ".")
|
destination info) ".")
|
||||||
|
|
Loading…
Reference in New Issue