diff --git a/lisp/ox.el b/lisp/ox.el index 40c9501f7..c3dc942b6 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -1994,6 +1994,8 @@ a tree with a select tag." (if (eq (car with-drawers-p) 'not) (member-ignore-case name (cdr with-drawers-p)) (not (member-ignore-case name with-drawers-p)))))))) + ((footnote-definition footnote-reference) + (not (plist-get options :with-footnotes))) ((headline inlinetask) (let ((with-tasks (plist-get options :with-tasks)) (todo (org-element-property :todo-keyword blob)) @@ -2230,9 +2232,6 @@ according to export options INFO, stored as a plist." (plist-get info :with-emphasize)) ;; ... fixed-width areas. (fixed-width (plist-get info :with-fixed-width)) - ;; ... footnotes... - ((footnote-definition footnote-reference) - (plist-get info :with-footnotes)) ;; ... LaTeX environments and fragments... ((latex-environment latex-fragment) (let ((with-latex-p (plist-get info :with-latex))) diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el index ab220f6b4..13533de46 100644 --- a/testing/lisp/test-ox.el +++ b/testing/lisp/test-ox.el @@ -361,6 +361,21 @@ Paragraph" (should (equal (org-export-as 'test nil nil nil '(:with-drawers (not "BAR"))) ":FOO:\nkeep\n:END:\n"))))) + ;; Footnotes. + (should + (equal "Footnote?" + (let ((org-footnote-section nil)) + (org-test-with-temp-text "Footnote?[fn:1]\n\n[fn:1] Def" + (org-test-with-backend test + (org-trim + (org-export-as 'test nil nil nil '(:with-footnotes nil)))))))) + (should + (equal "Footnote?[fn:1]\n\n[fn:1] Def" + (let ((org-footnote-section nil)) + (org-test-with-temp-text "Footnote?[fn:1]\n\n[fn:1] Def" + (org-test-with-backend test + (org-trim + (org-export-as 'test nil nil nil '(:with-footnotes t)))))))) ;; Inlinetasks. (when (featurep 'org-inlinetask) (should