summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2010-09-06 13:14:36 +0200
committerBastien Guerry <bzg@altern.org>2010-09-06 13:14:36 +0200
commit86f4ef6d1925cb482462c76ef62af6a6ce358550 (patch)
treec0fbc7bdd6ba0f49411887bf45559ea0346447f9
parentd2e071cd97d789e4a42c1a64eecee25b78eebca8 (diff)
downloadorg-mode-86f4ef6d1925cb482462c76ef62af6a6ce358550.tar.gz
Fix bug in ASCII export: correctly set the `type' variable.
* org-ascii.el (org-export-as-ascii): Fix bug in ASCII export: use `org-bracket-link-analytic-regexp++' to match the link type.
-rw-r--r--lisp/org-ascii.el17
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/org-ascii.el b/lisp/org-ascii.el
index 8bb8b5a..a7b8801 100644
--- a/lisp/org-ascii.el
+++ b/lisp/org-ascii.el
@@ -311,7 +311,7 @@ publishing directory."
:add-text (plist-get opt-plist :text))
"\n"))
thetoc have-headings first-heading-pos
- table-open table-buffer link-buffer link desc desc0 rpl wrap fnc)
+ table-open table-buffer link-buffer link type desc desc0 rpl wrap fnc)
(let ((inhibit-read-only t))
(org-unmodified
(remove-text-properties (point-min) (point-max)
@@ -347,7 +347,7 @@ publishing directory."
(if (and (or author email)
org-export-author-info)
- (insert(concat (nth 1 lang-words) ": " (or author "")
+ (insert (concat (nth 1 lang-words) ": " (or author "")
(if (and org-export-email-info
email (string-match "\\S-" email))
(concat " <" email ">") "")
@@ -431,10 +431,11 @@ publishing directory."
;; Remove the quoted HTML tags.
(setq line (org-html-expand-for-ascii line))
;; Replace links with the description when possible
- (while (string-match org-bracket-link-regexp line)
- (setq link (match-string 1 line)
- desc0 (match-string 3 line)
- desc (or desc0 (match-string 1 line)))
+ (while (string-match org-bracket-link-analytic-regexp++ line)
+ (setq link (concat (match-string 1 line) (match-string 3 line))
+ type (match-string 1 line)
+ desc0 (match-string 5 line)
+ desc (or desc0 link))
(if (and (> (length link) 8)
(equal (substring link 0 8) "coderef:"))
(setq line (replace-match
@@ -443,9 +444,7 @@ publishing directory."
(substring link 8)
org-export-code-refs)))
t t line))
- (setq rpl (concat "["
- (or (match-string 3 line) (match-string 1 line))
- "]"))
+ (setq rpl (concat "[" desc "]"))
(if (functionp (setq fnc (nth 2 (assoc type org-link-protocols))))
(setq rpl (or (save-match-data
(funcall fnc (org-link-unescape path)