ox: Fix uninterpreted subscript

* lisp/ox.el (org-export--remove-uninterpreted-data-1): Fix
  un-interpreted subscript containing another object.

* testing/lisp/test-ox.el (test-org-export/uninterpreted): Add test.

Reported-by: Yasushi SHOJI <yashi@atmark-techno.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/103553>
This commit is contained in:
Nicolas Goaziou 2015-12-12 00:38:39 +01:00
parent 06c6ba4ac3
commit 7d1a6777d0
2 changed files with 11 additions and 1 deletions

View File

@ -2757,7 +2757,7 @@ returned by the function."
(when new
;; 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))))))
(unless (equal e "") (org-element-insert-before e blob))))))
info nil nil t)
;; Return modified parse tree.
data)

View File

@ -778,6 +778,16 @@ Paragraph <2012-03-29 Thu>[2012-03-29 Thu]"
(paragraph . (lambda (p c i) c))
(section . (lambda (s c i) c))))
nil nil nil '(:with-sub-superscript {})))))
(should
(equal "a_entity\n"
(org-test-with-temp-text "a_\\alpha"
(org-export-as
(org-export-create-backend
:transcoders '((entity . (lambda (e c i) "entity"))
(subscript . (lambda (s c i) "dummy"))
(paragraph . (lambda (p c i) c))
(section . (lambda (s c i) c))))
nil nil nil '(:with-sub-superscript nil)))))
;; Also handle uninterpreted objects in title.
(should
(equal "a_b"