forked from mirrors/org-mode
Merge branch 'maint'
This commit is contained in:
commit
56ebac4092
|
@ -301,12 +301,11 @@ channel."
|
||||||
CONTENTS is the link's description. INFO is a plist used as
|
CONTENTS is the link's description. INFO is a plist used as
|
||||||
a communication channel."
|
a communication channel."
|
||||||
(let ((link-org-files-as-md
|
(let ((link-org-files-as-md
|
||||||
(function
|
|
||||||
(lambda (raw-path)
|
(lambda (raw-path)
|
||||||
;; Treat links to `file.org' as links to `file.md'.
|
;; Treat links to `file.org' as links to `file.md'.
|
||||||
(if (string= ".org" (downcase (file-name-extension raw-path ".")))
|
(if (string= ".org" (downcase (file-name-extension raw-path ".")))
|
||||||
(concat (file-name-sans-extension raw-path) ".md")
|
(concat (file-name-sans-extension raw-path) ".md")
|
||||||
raw-path))))
|
raw-path)))
|
||||||
(type (org-element-property :type link)))
|
(type (org-element-property :type link)))
|
||||||
(cond
|
(cond
|
||||||
;; Link type is handled by a special function.
|
;; Link type is handled by a special function.
|
||||||
|
@ -344,18 +343,20 @@ a communication channel."
|
||||||
(org-export-resolve-coderef ref info))))
|
(org-export-resolve-coderef ref info))))
|
||||||
((equal type "radio") contents)
|
((equal type "radio") contents)
|
||||||
((equal type "fuzzy")
|
((equal type "fuzzy")
|
||||||
(let ((destination (org-export-resolve-fuzzy-link link info)))
|
(let* ((destination (org-export-resolve-fuzzy-link link info))
|
||||||
(if (org-string-nw-p contents) contents
|
(description
|
||||||
(when destination
|
(or (org-string-nw-p contents)
|
||||||
(let ((number (org-export-get-ordinal destination info)))
|
(let ((number (org-export-get-ordinal destination info)))
|
||||||
(if number
|
(cond
|
||||||
(if (atom number) (number-to-string number)
|
((not number)
|
||||||
(mapconcat #'number-to-string number "."))
|
|
||||||
;; Unnumbered headline.
|
|
||||||
(and (eq 'headline (org-element-type destination))
|
(and (eq 'headline (org-element-type destination))
|
||||||
;; BUG: shouldn't headlines have a form like [ref](name) in md?
|
|
||||||
(org-export-data
|
(org-export-data
|
||||||
(org-element-property :title destination) info))))))))
|
(org-element-property :title destination) info)))
|
||||||
|
((atom number) (number-to-string number))
|
||||||
|
(t (mapconcat #'number-to-string number ".")))))))
|
||||||
|
(format "[%s](%s)"
|
||||||
|
description
|
||||||
|
(org-export-get-reference destination info))))
|
||||||
(t (let* ((raw-path (org-element-property :path link))
|
(t (let* ((raw-path (org-element-property :path link))
|
||||||
(path
|
(path
|
||||||
(cond
|
(cond
|
||||||
|
|
Loading…
Reference in a new issue