Fix exporting LaTeX fragments within inline footnotes

* lisp/ox.el (org-export--prune-tree): Do not change parent by side
  effect. It affects footnote references already in the tree.

Reported-by: Paul Stansell <paulstansell@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-08/msg00302.html>
This commit is contained in:
Nicolas Goaziou 2017-08-13 15:11:48 +02:00
parent bff63cbeb3
commit 5bf7730674
1 changed files with 5 additions and 8 deletions

View File

@ -2712,14 +2712,11 @@ from tree."
(org-element-map data '(footnote-definition footnote-reference) (org-element-map data '(footnote-definition footnote-reference)
(lambda (f) (lambda (f)
(cond (cond
((eq (org-element-type f) 'footnote-definition) f) ((eq 'footnote-definition (org-element-type f)) f)
((eq (org-element-property :type f) 'standard) nil) ((and (eq 'inline (org-element-property :type f))
(t (let ((label (org-element-property :label f))) (org-element-property :label f))
(when label ;Skip anonymous references. f)
(apply (t nil))))))
#'org-element-create
'footnote-definition `(:label ,label :post-blank 1)
(org-element-contents f))))))))))
;; If a select tag is active, also ignore the section before the ;; If a select tag is active, also ignore the section before the
;; first headline, if any. ;; first headline, if any.
(when selected (when selected