Merge branch 'bugfix'

This commit is contained in:
Ihor Radchenko 2023-12-15 15:02:45 +01:00
commit 15cf8c3fcd
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
2 changed files with 44 additions and 1 deletions

View File

@ -305,7 +305,7 @@ INFO is a plist used as a communication channel."
(section-title (org-html--translate "Footnotes" info)))
(when fn-alist
(format (plist-get info :md-footnotes-section)
(org-md--headline-title headline-style 1 section-title)
(org-md--headline-title headline-style (plist-get info :md-toplevel-hlevel) section-title)
(mapconcat (lambda (fn) (org-md--footnote-formatted fn info))
fn-alist
"\n")))))

View File

@ -0,0 +1,43 @@
;;; test-ox-md.el --- Tests from ox-md.el -*- lexical-binding: t; -*-
;; Copyright (C) 2023 Ihor Radchenko
;; Author: Ihor Radchenko <yantar92@posteo.net>
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Code:
(require 'ox-md)
(ert-deftest ox-md/footnotes-level ()
"Test `org-md-toplevel-hlevel' being honored by footnote section."
(org-test-with-temp-text "
** level 1
Post starts here. [fn:1]
*** level2
lorem ipsum
** Footnotes
[fn:1] a footnote
"
(let ((org-md-toplevel-hlevel 4)
(export-buffer "*Test MD Export*")
(org-export-show-temporary-export-buffer nil))
(org-export-to-buffer 'md export-buffer)
(with-current-buffer export-buffer
(goto-char (point-min))
(should (search-forward "#### Footnotes"))))))
(provide 'test-ox-md)
;;; test-ox-md.el ends here