From 2e548f1bc696db90d11024600d5ccce73131135f Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Sat, 30 Apr 2022 13:11:13 +0300 Subject: Allow an ATX heading block to precede with up to 3 spaces --- test/clarktown/renderers/heading_block_test.clj | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'test/clarktown/renderers') diff --git a/test/clarktown/renderers/heading_block_test.clj b/test/clarktown/renderers/heading_block_test.clj index 7647b53..8f229fb 100644 --- a/test/clarktown/renderers/heading_block_test.clj +++ b/test/clarktown/renderers/heading_block_test.clj @@ -35,7 +35,20 @@ (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))))) + (heading-block/render "#This is not a heading block." nil nil)))) + + (testing "ATX heading can precede up to 3 spaces" + (is (= "

This is a heading.

" + (heading-block/render " # This is a heading." nil nil))) + (is (= "

This is a heading.

" + (heading-block/render " # This is a heading." nil nil))) + (is (= "

This is a heading.

" + (heading-block/render " # This is a heading." nil nil)))) + + (testing "But no more than 3 spaces" + (is (= " # This is a heading." + (heading-block/render " # This is a heading." nil nil))))) + (deftest settext-heading-renderer-text -- cgit v1.2.3