ox-org: Correctly export footnote references in headlines

* lisp/ox-org.el (org-org-section): Also include references found in
  headlines when inserting footnote definitions at the end of
  a section.

Reported-by: WY H <jcjuly@outlook.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112678>
This commit is contained in:
Nicolas Goaziou 2017-03-15 11:51:16 +01:00
parent 6cd42b08f9
commit 0fd2256eba
1 changed files with 6 additions and 4 deletions

View File

@ -193,16 +193,18 @@ a communication channel."
(concat
(org-element-normalize-string contents)
;; Insert footnote definitions appearing for the first time in this
;; section. Indeed, some of them may not be available to narrowing
;; so we make sure all of them are included in the result.
;; section, or in the relative headline title. Indeed, some of
;; them may not be available to narrowing so we make sure all of
;; them are included in the result.
(let ((footnotes-alist
(org-element-map section 'footnote-reference
(org-element-map (list (org-element-property :parent section) section)
'footnote-reference
(lambda (fn)
(and (eq (org-element-property :type fn) 'standard)
(org-export-footnote-first-reference-p fn info)
(cons (org-element-property :label fn)
(org-export-get-footnote-definition fn info))))
info)))
info nil 'headline t)))
(and footnotes-alist
(concat "\n"
(mapconcat