-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.el
24 lines (20 loc) · 1.08 KB
/
test.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
(require 'ert)
(load-file "ox-html-markdown-style-footnotes.el")
(ert-deftest footnote-test ()
(org-html-markdown-style-footnotes-add)
(find-file "test/fixtures/footnote.org")
(let ((org-html-markdown-style-footnotes t))
(org-html-export-as-html))
(should (string-match-p
"<ol>\n<li id=\"fn.1\" class=\"footdef\" role=\"doc-footnote\" tabindex=\"-1\"><p class=\"footpara\">\nA footnote.\n</p>\n\n<p class=\"footpara\">\nWith a second paragraph.\n</p> <a href=\"#fnr.1\" role=\"doc-backlink\">↩︎</a></li>\n</ol>"
(with-current-buffer "*Org HTML Export*" (buffer-string))))
(org-html-markdown-style-footnotes-remove))
(ert-deftest disabled-test ()
(org-html-markdown-style-footnotes-add)
(find-file "test/fixtures/footnote.org")
(let ((org-html-markdown-style-footnotes nil))
(org-html-export-as-html))
(let ((buffer (with-current-buffer "*Org HTML Export*" (buffer-string))))
(should-not (string-match-p "<li class=\"footdef\"" buffer))
(should (string-match-p "<div class=\"footdef\"" buffer)))
(org-html-markdown-style-footnotes-remove))