(require 'package) (package-initialize) (load-file "ox-plumhtml.el") (defun should-render-as (expected-result org-source &optional info skip-newline) (let ((expected-result (if skip-newline expected-result (concat expected-result "\n"))) (info (plist-put info :html-container nil))) (should (string= expected-result (org-export-string-as org-source 'plumhtml t info))))) (defun regexp-render-as (expected-regexp org-source &optional info) (let ((info (plist-put info :html-container nil))) (should (string-match-p expected-regexp (org-export-string-as org-source 'plumhtml t info))))) ;; Tables (ert-deftest body () (should-render-as "\n
body
" "|body|")) (ert-deftest multi-line-body () (should-render-as "\n\n
two
lines
" "|two|\n|lines|")) (ert-deftest header-no-body () (should-render-as "\n
just a header
" "|just a header|\n|---|")) (ert-deftest header-and-body () (should-render-as "\n\n
header
body
" "|header|\n|---|\n|body|")) (ert-deftest header-and-multi-line-body () (should-render-as "\n\n\n\n
header
line 1
line 2
line 3
" "|header|\n|---|\n|line 1|\n|line 2|\n|line 3|")) (ert-deftest header-and-multiple-bodies () (should-render-as "\n\n\n
header
two
bodies
" "|header|\n|---|\n|two|\n|---|\n|bodies|")) (ert-deftest header-and-body () (should-render-as "\n\n\n
multi-line
header
body
" "|multi-line|\n|header|\n|---|\n|body|")) ;; Headers and IDs (ert-deftest header () (should-render-as "

mwee

" "* mwee")) (ert-deftest header-export-ids () (regexp-render-as "

mwee

" "* mwee" '(:export-header-ids t))) (ert-deftest link-without-content () (should-render-as "

https://flanchan.moe

" "[[https://flanchan.moe]]")) ;; Links and IDs (ert-deftest link () (should-render-as "

example

" "[[https://example.com][example]]"))