[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org abaee57ce6: Merge branch 'bugfix'
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org abaee57ce6: Merge branch 'bugfix' |
Date: |
Sat, 23 Jul 2022 02:57:44 -0400 (EDT) |
branch: externals/org
commit abaee57ce65a0c4dc17f56a77a10f44cc355a0dc
Merge: 97cfb959d1 e5cf0bc840
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>
Merge branch 'bugfix'
---
lisp/ox-ascii.el | 17 +++++++++++------
lisp/ox-md.el | 9 ++++-----
lisp/ox.el | 6 ++++--
3 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el
index 6fcde013b5..3c39225a3c 100644
--- a/lisp/ox-ascii.el
+++ b/lisp/ox-ascii.el
@@ -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.
diff --git a/lisp/ox-md.el b/lisp/ox-md.el
index 127c70cbc5..c268aa5ddd 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)
diff --git a/lisp/ox.el b/lisp/ox.el
index 8420db7fc6..03af47001f 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -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.