diff options
| author | Asko Nõmm <84135165+askonomm@users.noreply.github.com> | 2022-04-30 12:12:28 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-30 12:12:28 +0300 |
| commit | faf11bf88b598d55f81899784c7c16e32a8d415d (patch) | |
| tree | 287468b35b2815a7164225883669e070bde39b63 /test/clarktown/renderers | |
| parent | d6e39c016e16b60b85b60898e93eda8d2c6f00db (diff) | |
| parent | ee7ab7fd1163a1a8444e16017793eb32a0eb08ee (diff) | |
Merge pull request #25 from askonomm/issue-22
Improve ATX heading blocks
Diffstat (limited to 'test/clarktown/renderers')
| -rw-r--r-- | test/clarktown/renderers/heading_block_test.clj | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/test/clarktown/renderers/heading_block_test.clj b/test/clarktown/renderers/heading_block_test.clj index 2196422..7647b53 100644 --- a/test/clarktown/renderers/heading_block_test.clj +++ b/test/clarktown/renderers/heading_block_test.clj @@ -5,25 +5,37 @@ (deftest atx-heading-renderer-test - (testing "Hashbang heading block that's a H1" + (testing "ATX heading block that's a H1" (is (= "<h1>This is a heading block.</h1>" (heading-block/render "# This is a heading block." nil nil)))) - (testing "Hashbang heading block that's a H2" + (testing "ATX heading block that's a H2" (is (= "<h2>This is a heading block.</h2>" (heading-block/render "## This is a heading block." nil nil)))) - (testing "Hashbang heading block that's a H3" + (testing "ATX heading block that's a H3" (is (= "<h3>This is a heading block.</h3>" (heading-block/render "### This is a heading block." nil nil)))) - (testing "Hashbang heading block that's a H4" + (testing "ATX heading block that's a H4" (is (= "<h4>This is a heading block.</h4>" (heading-block/render "#### This is a heading block." nil nil)))) - (testing "Hashbang heading block that's a H5" + (testing "ATX heading block that's a H5" (is (= "<h5>This is a heading block.</h5>" - (heading-block/render "##### This is a heading block." nil nil))))) + (heading-block/render "##### This is a heading block." nil nil)))) + + (testing "ATX heading block that's a H6" + (is (= "<h6>This is a heading block.</h6>" + (heading-block/render "###### This is a heading block." nil nil)))) + + (testing "No H tag when 7 or more # characters" + (is (= "####### This is not a heading block." + (heading-block/render "####### This is not a heading block." nil nil)))) + + (testing "No H tag when there is no space between # characters and value" + (is (= "#This is not a heading block." + (heading-block/render "#This is not a heading block." nil nil))))) (deftest settext-heading-renderer-text @@ -41,4 +53,4 @@ (testing "Settext heading block that's a H2 spanning multiple lines" (is (= "<h2>This is a \nheading block spanning multiple lines.</h2>" - (heading-block/render "This is a \nheading block spanning multiple lines.\n--------" nil nil)))))
\ No newline at end of file + (heading-block/render "This is a \nheading block spanning multiple lines.\n--------" nil nil))))) |
