mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 18:36:26 +00:00
ox-odt: Fix exporting target link without a description
* lisp/ox-odt.el (org-odt-link--infer-description): Fix comment. (org-odt-link): When link to target has no description, use a number. Reported-by: Christian Moe <mail@christianmoe.com> <http://permalink.gmane.org/gmane.emacs.orgmode/94815>
This commit is contained in:
parent
ddaa1d745c
commit
880a2b4f90
|
@ -2610,11 +2610,12 @@ Return nil, otherwise."
|
|||
(t nil))))))))
|
||||
|
||||
(defun org-odt-link--infer-description (destination info)
|
||||
;; DESTINATION is a HEADLINE, a "<<target>>" or an element (like
|
||||
;; paragraph, verse-block etc) to which a "#+NAME: label" can be
|
||||
;; attached. Note that labels that are attached to captioned
|
||||
;; entities - inline images, math formulae and tables - get resolved
|
||||
;; as part of `org-odt-format-label' and `org-odt--enumerate'.
|
||||
;; DESTINATION is a headline or an element (like paragraph,
|
||||
;; verse-block etc) to which a "#+NAME: label" can be attached.
|
||||
|
||||
;; Note that labels that are attached to captioned entities - inline
|
||||
;; images, math formulae and tables - get resolved as part of
|
||||
;; `org-odt-format-label' and `org-odt--enumerate'.
|
||||
|
||||
;; Create a cross-reference to DESTINATION but make best-efforts to
|
||||
;; create a *meaningful* description. Check item numbers, section
|
||||
|
@ -2770,11 +2771,10 @@ INFO is a plist holding contextual information. See
|
|||
(target
|
||||
;; If there's a description, create a hyperlink.
|
||||
;; Otherwise, try to provide a meaningful description.
|
||||
(if (not desc) (org-odt-link--infer-description destination info)
|
||||
(let ((label (org-element-property :value destination)))
|
||||
(format "<text:a xlink:type=\"simple\" xlink:href=\"#%s\">%s</text:a>"
|
||||
(org-export-solidify-link-text label)
|
||||
desc))))
|
||||
(let ((label (org-element-property :value destination)))
|
||||
(format "<text:a xlink:type=\"simple\" xlink:href=\"#%s\">%s</text:a>"
|
||||
(org-export-solidify-link-text label)
|
||||
(or desc (org-export-get-ordinal destination info)))))
|
||||
;; Case 4: Fuzzy link points to some element (e.g., an
|
||||
;; inline image, a math formula or a table).
|
||||
(otherwise
|
||||
|
|
Loading…
Reference in a new issue