summaryrefslogtreecommitdiff
path: root/src/clarktown/matchers/indented_code_block.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/clarktown/matchers/indented_code_block.clj')
-rw-r--r--src/clarktown/matchers/indented_code_block.clj10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/clarktown/matchers/indented_code_block.clj b/src/clarktown/matchers/indented_code_block.clj
new file mode 100644
index 0000000..b7cf563
--- /dev/null
+++ b/src/clarktown/matchers/indented_code_block.clj
@@ -0,0 +1,10 @@
+(ns clarktown.matchers.indented-code-block
+ (:require
+ [clojure.string :as string]))
+
+
+(defn match?
+ "Determines whether the given block is a indented code block."
+ [block]
+ (->> (string/split-lines block)
+ (every? #(>= (count (take-while #{\space} %)) 4)))) \ No newline at end of file