Skip to content

Commit

Permalink
ox-ascii: Fix export with broken links
Browse files Browse the repository at this point in the history
* lisp/ox-ascii.el (org-ascii--describe-links): Skip broken links.
  • Loading branch information
yantar92 committed Jul 23, 2022
1 parent c779b7a commit 4631790
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lisp/ox-ascii.el
Original file line number Diff line number Diff line change
Expand Up @@ -948,12 +948,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.
Expand Down

0 comments on commit 4631790

Please sign in to comment.