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

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

[elpa] externals-release/org 14532ec6a5 2/3: ox-md: Fix export with brok


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

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

    ox-md: Fix export with broken links
    
    * lisp/ox-md.el (org-md--headline-referred-p): Allow exporting
    headlines when the document contains broken links and
    `org-export-with-broken-links' is non-nil.  For broken links,
    `org-export-resolve-link' throws an error - catch it and do not match
    the headline against such broken link.
---
 lisp/ox-md.el | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lisp/ox-md.el b/lisp/ox-md.el
index ad684d8033..91b7ee6571 100644
--- a/lisp/ox-md.el
+++ b/lisp/ox-md.el
@@ -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)



reply via email to

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