ox-texinfo: Fix @ref{...} handling

* lisp/ox-texinfo.el (org-texinfo-link): Fix @ref{...} handling.  Use
  third argument as description.  Without description, use
  one-argument @ref.
This commit is contained in:
Nicolas Goaziou 2017-06-06 00:21:53 +02:00
parent 439fcfbbf2
commit 6f12dfbcb0
1 changed files with 6 additions and 10 deletions

View File

@ -974,16 +974,12 @@ INFO is a plist holding contextual information. See
(if desc (format "@uref{file://%s,%s}" destination desc)
(format "@uref{file://%s}" destination)))
(`headline
(format "@ref{%s,%s}"
(org-texinfo--get-node destination info)
(cond
(desc)
((org-export-numbered-headline-p destination info)
(mapconcat
#'number-to-string
(org-export-get-headline-number destination info) "."))
(t (org-export-data
(org-element-property :title destination) info)))))
(let ((node-name (org-texinfo--get-node destination info)))
(if desc
(format "@ref{%s, , %s}"
node-name
(org-texinfo--sanitize-node desc))
(format "@ref{%s}" node-name))))
(_
(format "@ref{%s,,%s}"
(org-texinfo--get-node destination info)