0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 22:07:49 +00:00

ox-ascii: Fix export with broken links

* lisp/ox-ascii.el (org-ascii--describe-links): Skip broken links.
This commit is contained in:
Ihor Radchenko 2022-07-23 14:07:20 +08:00
parent c779b7aa0e
commit 4631790fb9
No known key found for this signature in database
GPG key ID: 6470762A7DA11D8B

View file

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