summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2013-02-03 19:44:51 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2013-02-03 19:44:51 +0100
commit9ca48c15e1e21419a85e04ec1c034dac2f5d7609 (patch)
treefeceee825c9b3adb8a9f033ff748af032ca88907
parent413a35f7f843f81d60826532c004cd86bb2b2dcd (diff)
downloadorg-mode-9ca48c15e1e21419a85e04ec1c034dac2f5d7609.tar.gz
org-export: Fix smart quote bug with footnote definitions in ascii back-end
* contrib/lisp/org-export.el (org-export-activate-smart-quotes): Fix error when exporting a footnote definition.
-rw-r--r--contrib/lisp/org-export.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/contrib/lisp/org-export.el b/contrib/lisp/org-export.el
index db78b90..54b5c2e 100644
--- a/contrib/lisp/org-export.el
+++ b/contrib/lisp/org-export.el
@@ -4552,7 +4552,18 @@ original string.
Return the new string."
(if (equal s "") ""
(let* ((prev (org-export-get-previous-element (or original s) info))
- (pre-blank (and prev (org-element-property :post-blank prev)))
+ ;; Try to be flexible when computing number of blanks
+ ;; before object. The previous object may be a string
+ ;; introduced by the back-end and not completely parsed.
+ (pre-blank (and prev
+ (or (org-element-property :post-blank prev)
+ ;; A string with missing `:post-blank'
+ ;; property.
+ (and (stringp prev)
+ (string-match " *\\'" prev)
+ (length (match-string 0 prev)))
+ ;; Fallback value.
+ 0)))
(next (org-export-get-next-element (or original s) info))
(get-smart-quote
(lambda (q type)