mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 21:37:50 +00:00
ox-texinfo: Fix footnotes ending on a special environment
* lisp/ox-texinfo.el (org-texinfo-footnote-reference): Prevent a footnote from ending on an "@end" line. Reported-by: Ramesh Nedunchezian <rameshnedunchezian@outlook.com> <http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00228.html>
This commit is contained in:
parent
4056e11ddc
commit
6dbd132e62
|
@ -846,9 +846,17 @@ CONTENTS is nil. INFO is a plist holding contextual information."
|
|||
|
||||
FOOTNOTE is the footnote to define. CONTENTS is nil. INFO is a
|
||||
plist holding contextual information."
|
||||
(let ((def (org-export-get-footnote-definition footnote info)))
|
||||
(let* ((contents (org-export-get-footnote-definition footnote info))
|
||||
(data (org-export-data contents info)))
|
||||
(format "@footnote{%s}"
|
||||
(org-trim (org-export-data def info)))))
|
||||
;; It is invalid to close a footnote on a line starting
|
||||
;; with "@end". As a safety net, we leave a newline
|
||||
;; character before the closing brace. However, when the
|
||||
;; footnote ends with a paragraph, it is visually pleasing
|
||||
;; to move the brace right after its end.
|
||||
(if (eq 'paragraph (org-element-type (org-last contents)))
|
||||
(org-trim data)
|
||||
data))))
|
||||
|
||||
;;;; Headline
|
||||
|
||||
|
|
Loading…
Reference in a new issue