emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals-release/org 4631790fb9 1/3: ox-ascii: Fix export with b


From: ELPA Syncer
Subject: [elpa] externals-release/org 4631790fb9 1/3: ox-ascii: Fix export with broken links
Date: Sat, 23 Jul 2022 02:57:44 -0400 (EDT)

branch: externals-release/org
commit 4631790fb90cc46bc205ccbf53689ced3fa33f0a
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>

    ox-ascii: Fix export with broken links
    
    * lisp/ox-ascii.el (org-ascii--describe-links): Skip broken links.
---
 lisp/ox-ascii.el | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el
index 38b2a5772c..88a75a8156 100644
--- a/lisp/ox-ascii.el
+++ b/lisp/ox-ascii.el
@@ -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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]