diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-08-25 13:59:03 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-08-25 14:44:20 +0200 |
commit | 48f009bc9f44ecd422d5b617a8d3235f3552c1a2 (patch) | |
tree | 2bf3db2218461d1a958cb90041c9cec2dbc18f4d | |
parent | 06966b940377943d85dff55a602adce2909bd02b (diff) | |
download | org-mode-48f009bc9f44ecd422d5b617a8d3235f3552c1a2.tar.gz |
ox: Fix uninterpreted data in captions
* lisp/ox.el (org-export--remove-uninterpreted-data-1): Handle
uninterpreted data in captions.
* testing/lisp/test-ox.el (test-org-export/uninterpreted): Add tests.
Reported-by: Johannes Rainer <johannes.rainer@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/100476>
-rw-r--r-- | lisp/ox.el | 2 | ||||
-rw-r--r-- | testing/lisp/test-ox.el | 23 |
2 files changed, 24 insertions, 1 deletions
@@ -2732,7 +2732,7 @@ returned by the function." ;; Splice NEW at BLOB location in parse tree. (dolist (e new (org-element-extract-element blob)) (unless (string= e "") (org-element-insert-before e blob)))))) - info) + info nil nil t) ;; Return modified parse tree. data) diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el index e795226..ed4a483 100644 --- a/testing/lisp/test-ox.el +++ b/testing/lisp/test-ox.el @@ -762,6 +762,29 @@ Paragraph <2012-03-29 Thu>[2012-03-29 Thu]" (plist-get i :title) i))) (section . (lambda (s c i) c)))) nil nil nil '(:with-sub-superscript nil))))) + ;; Handle uninterpreted objects in captions. + (should + (equal "adummy\n" + (org-test-with-temp-text "#+CAPTION: a_b\nParagraph" + (org-export-as + (org-export-create-backend + :transcoders + '((subscript . (lambda (s c i) "dummy")) + (paragraph . (lambda (p c i) + (org-export-data (org-export-get-caption p) i))) + (section . (lambda (s c i) c)))) + nil nil nil '(:with-sub-superscript t))))) + (should + (equal "a_b\n" + (org-test-with-temp-text "#+CAPTION: a_b\nParagraph" + (org-export-as + (org-export-create-backend + :transcoders + '((subscript . (lambda (s c i) "dummy")) + (paragraph . (lambda (p c i) + (org-export-data (org-export-get-caption p) i))) + (section . (lambda (s c i) c)))) + nil nil nil '(:with-sub-superscript nil))))) ;; Special case: multiples uninterpreted objects in a row. (should (equal "a_b_c_d\n" |