Fix bug with handling of targets in ASCII export.

Target text used to disappear, now it is kept as it should be.
This commit is contained in:
Carsten Dominik 2008-11-26 07:32:10 +01:00
parent 825fdfa95e
commit c0a779bd9d
2 changed files with 14 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2008-11-26 Carsten Dominik <carsten.dominik@gmail.com>
* org-exp.el (org-export-as-ascii): Remove the handling of
targets.
(org-export-ascii-preprocess): Handle targets already in this
function.
2008-11-25 Carsten Dominik <carsten.dominik@gmail.com>
* org-timer.el (org-timer-start-time): Define this variable.

View File

@ -2397,10 +2397,7 @@ underlined headlines. The default is 3."
(while (setq line (pop lines))
;; Remove the quoted HTML tags.
(setq line (org-html-expand-for-ascii line))
;; Remove targets
(while (string-match "<<<?[^<>]*>>>?[ \t]*\n?" line)
(setq line (replace-match "" t t line)))
;; Replace internal links
;; Replace links with the description when possible
(while (string-match org-bracket-link-regexp line)
(setq line (replace-match
(if (match-end 3) "[\\3]" "[\\1]")
@ -2483,13 +2480,18 @@ underlined headlines. The default is 3."
(defun org-export-ascii-preprocess ()
"Do extra work for ASCII export"
;; Put quotes around verbatim text
(goto-char (point-min))
(while (re-search-forward org-verbatim-re nil t)
(goto-char (match-end 2))
(backward-delete-char 1) (insert "'")
(goto-char (match-beginning 2))
(delete-char 1) (insert "`")
(goto-char (match-end 2))))
(goto-char (match-end 2)))
(goto-char (point-min))
;; Remove target markers
(while (re-search-forward "<<<?\\([^<>]*\\)>>>?\\([ \t]*\\)" nil t)
(replace-match "\\1\\2")))
(defun org-search-todo-below (line lines level)
"Search the subtree below LINE for any TODO entries."