summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2015-10-18 00:02:31 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-10-18 00:02:31 +0200
commitd6a718a93fc53fff68c9497ab181938b09950f10 (patch)
treec331fe9fd2fe28fde44b011f26ce1072499d91a7
parent9de1ee1b6fa5099f344c973881597012a06a9138 (diff)
downloadorg-mode-d6a718a93fc53fff68c9497ab181938b09950f10.tar.gz
ox-ascii: Fix external id links
* lisp/ox-ascii.el (org-ascii--describe-links): Fix export when id link targets an external file. Reported-by: Samuel Wales <samologist@gmail.com> <http://permalink.gmane.org/gmane.emacs.orgmode/101978>
-rw-r--r--lisp/ox-ascii.el30
1 files changed, 17 insertions, 13 deletions
diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el
index 5cc70bd..deb98a6 100644
--- a/lisp/ox-ascii.el
+++ b/lisp/ox-ascii.el
@@ -916,19 +916,23 @@ channel."
;; Id and custom-id links: Headlines refer to their numbering.
((member type '("custom-id" "id"))
(let ((dest (org-export-resolve-id-link link info)))
- (concat
- (org-ascii--fill-string
- (format
- "[%s] %s"
- anchor
- (if (not dest) (org-ascii--translate "Unknown reference" info)
- (format
- (org-ascii--translate "See section %s" info)
- (if (org-export-numbered-headline-p dest info)
- (mapconcat #'number-to-string
- (org-export-get-headline-number dest info) ".")
- (org-export-data (org-element-property :title dest) info)))))
- width info) "\n\n")))
+ (if (concat
+ (org-ascii--fill-string
+ (format
+ "[%s] %s"
+ anchor
+ (if (stringp dest) ; External file.
+ dest
+ (format
+ (org-ascii--translate "See section %s" info)
+ (if (org-export-numbered-headline-p dest info)
+ (mapconcat #'number-to-string
+ (org-export-get-headline-number dest info)
+ ".")
+ (org-export-data
+ (org-element-property :title 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.