forked from mirrors/org-mode
org-exp: normalize footnotes after removing commented subtrees
* lisp/org-exp.el (org-export-preprocess-string): if the last subtree is commented, footnotes inserted during normalizing at the end of the buffer may get deleted. This patch ensures deletion comes first, normalization second.
This commit is contained in:
parent
39d4bfa0e8
commit
56b558d15a
|
@ -1119,10 +1119,6 @@ on this string to produce the exported version."
|
||||||
(org-export-handle-include-files-recurse)
|
(org-export-handle-include-files-recurse)
|
||||||
(run-hooks 'org-export-preprocess-after-include-files-hook)
|
(run-hooks 'org-export-preprocess-after-include-files-hook)
|
||||||
|
|
||||||
;; Normalize footnotes
|
|
||||||
(when (plist-get parameters :footnotes)
|
|
||||||
(org-footnote-normalize nil 'pre-process-p))
|
|
||||||
|
|
||||||
;; Change lists ending. Other parts of export may insert blank
|
;; Change lists ending. Other parts of export may insert blank
|
||||||
;; lines and lists' structure could be altered.
|
;; lines and lists' structure could be altered.
|
||||||
(org-export-mark-list-end)
|
(org-export-mark-list-end)
|
||||||
|
@ -1142,6 +1138,10 @@ on this string to produce the exported version."
|
||||||
(plist-get parameters :exclude-tags))
|
(plist-get parameters :exclude-tags))
|
||||||
(run-hooks 'org-export-preprocess-after-tree-selection-hook)
|
(run-hooks 'org-export-preprocess-after-tree-selection-hook)
|
||||||
|
|
||||||
|
;; Normalize footnotes
|
||||||
|
(when (plist-get parameters :footnotes)
|
||||||
|
(org-footnote-normalize nil 'pre-process-p))
|
||||||
|
|
||||||
;; Get rid of tasks, depending on configuration
|
;; Get rid of tasks, depending on configuration
|
||||||
(org-export-remove-tasks (plist-get parameters :tasks))
|
(org-export-remove-tasks (plist-get parameters :tasks))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue