diff options
| author | Asko Nomm <asko@bien.ee> | 2022-04-07 11:26:12 +0200 |
|---|---|---|
| committer | Asko Nomm <asko@bien.ee> | 2022-04-07 11:26:12 +0200 |
| commit | 7da1fada8dd795543e12c6aa0371cc1149a42be6 (patch) | |
| tree | d7d49e298b3cb5eec809ad7ffd25d79230fc8225 | |
| parent | c0c8a2e49d395b574c7a31727c06f315139d7336 (diff) | |
Add core overall test and fix code block ending being broken.
| -rw-r--r-- | resources/test/parsers/code_block_result.html | 3 | ||||
| -rw-r--r-- | src/clarktown/parsers/code_block.clj | 2 | ||||
| -rw-r--r-- | test/clarktown/core_test.clj | 10 |
3 files changed, 11 insertions, 4 deletions
diff --git a/resources/test/parsers/code_block_result.html b/resources/test/parsers/code_block_result.html index e95e481..21b9214 100644 --- a/resources/test/parsers/code_block_result.html +++ b/resources/test/parsers/code_block_result.html @@ -35,4 +35,5 @@ function markdownToHTML(markdown) { }); // And at last, join the blocks together for one big block. - return parsedBlocks.join("");</code></pre>
\ No newline at end of file + return parsedBlocks.join(""); +}</code></pre>
\ No newline at end of file diff --git a/src/clarktown/parsers/code_block.clj b/src/clarktown/parsers/code_block.clj index a5de41c..388776f 100644 --- a/src/clarktown/parsers/code_block.clj +++ b/src/clarktown/parsers/code_block.clj @@ -18,7 +18,7 @@ second) code (as-> block n (string/replace-first n #"\`\`\`(\w+)?\n" "") - (subs n 0 (- (count n) 5)) + (subs n 0 (- (count n) 4)) (string/replace n #"&" "&") (string/replace n #"<" "<") (string/replace n #">" ">") diff --git a/test/clarktown/core_test.clj b/test/clarktown/core_test.clj index da252c7..8a2ee58 100644 --- a/test/clarktown/core_test.clj +++ b/test/clarktown/core_test.clj @@ -1,4 +1,10 @@ (ns clarktown.core-test (:require - [clojure.test :refer :all] - [clarktown.core :refer :all]))
\ No newline at end of file + [clojure.test :refer [deftest testing is]] + [clarktown.core :as core])) + + +(deftest overall-test + (testing "Overall" + (is (= (slurp "./resources/test/core_result.html") + (core/render (slurp "./resources/test/core.md"))))))
\ No newline at end of file |
