Merge branch 'bugfix'

This commit is contained in:
Ihor Radchenko 2022-07-23 14:17:37 +08:00
commit abaee57ce6
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
3 changed files with 19 additions and 13 deletions

View File

@ -951,12 +951,17 @@ channel."
(when description
(let ((dest (if (equal type "fuzzy")
(org-export-resolve-fuzzy-link link info)
(org-export-resolve-id-link link info))))
(concat
(org-ascii--fill-string
(format "[%s] %s" anchor (org-ascii--describe-datum dest info))
width info)
"\n\n"))))
;; Ignore broken links. On broken link,
;; `org-export-resolve-id-link' will throw an
;; error and `ignore-error' will return nil.
(ignore-error 'org-link-broken
(org-export-resolve-id-link link info)))))
(when dest
(concat
(org-ascii--fill-string
(format "[%s] %s" anchor (org-ascii--describe-datum dest info))
width info)
"\n\n")))))
;; Do not add a link that cannot be resolved and doesn't have
;; any description: destination is already visible in the
;; paragraph.

View File

@ -193,11 +193,10 @@ of contents can refer to headlines."
;; A link refers internally to HEADLINE.
(org-element-map (plist-get info :parse-tree) 'link
(lambda (link)
(eq headline
(pcase (org-element-property :type link)
((or "custom-id" "id") (org-export-resolve-id-link link info))
("fuzzy" (org-export-resolve-fuzzy-link link info))
(_ nil))))
(equal headline
;; Ignore broken links.
(ignore-error 'org-link-broken
(org-export-resolve-link link info))))
info t))))
(defun org-md--headline-title (style level title &optional anchor tags)

View File

@ -1912,8 +1912,10 @@ Return a string."
(org-element-property :archivedp data)))
(let ((transcoder (org-export-transcoder data info)))
(or (and (functionp transcoder)
(broken-link-handler
(funcall transcoder data nil info)))
(if (eq type 'link)
(broken-link-handler
(funcall transcoder data nil info))
(funcall transcoder data nil info)))
;; Export snippets never return a nil value so
;; that white spaces following them are never
;; ignored.