summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJambunathan K <kjambunathan@gmail.com>2012-03-01 19:11:53 +0530
committerJambunathan K <kjambunathan@gmail.com>2012-03-01 19:16:04 +0530
commit8506c90c4bc680cd22ea1a1e46ee52726c38bb9a (patch)
treef968d84c64f17935bde88ffbdd0409d185a04932
parentf6727a9ddecc638e1d4c079a0fe7faa2618d4a65 (diff)
downloadorg-mode-8506c90c4bc680cd22ea1a1e46ee52726c38bb9a.tar.gz
org-lparse.el: Correctly handle footnote refs in a list item
* org-lparse.el (org-lparse-end-footnote-definition): Cleanup newlines in a transcoded footnote definition. This ensures that the line that is currently being processed by `org-do-lparse' loop doesn't get broken up into multiple lines. Fix for the following bug -
-rw-r--r--lisp/org-lparse.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/org-lparse.el b/lisp/org-lparse.el
index d606361..8530757 100644
--- a/lisp/org-lparse.el
+++ b/lisp/org-lparse.el
@@ -1813,6 +1813,12 @@ Stripping happens only when the exported backend is not one of
(org-lparse-end 'FOOTNOTE-DEFINITION n)
(setq org-lparse-insert-tag-with-newlines 'both)
(let ((footnote-def (org-lparse-end-collect)))
+ ;; Cleanup newlines in footnote definition. This ensures that a
+ ;; transcoded line is never (wrongly) broken in to multiple lines.
+ (let ((pos 0))
+ (while (string-match "[\r\n]+" footnote-def pos)
+ (setq pos (1+ (match-beginning 0)))
+ (setq footnote-def (replace-match " " t t footnote-def))))
(push (cons n footnote-def) org-lparse-footnote-definitions)))
(defvar org-lparse-collect-buffer nil