summaryrefslogtreecommitdiff
path: root/src/clarktown/matchers
diff options
context:
space:
mode:
authorAsko Nõmm <ano@ano.ee>2022-05-11 20:42:30 +0300
committerAsko Nõmm <ano@ano.ee>2022-05-11 20:42:30 +0300
commit7c3eba77fd3de0e108efba94018233a57e66989e (patch)
treeae7e3c28a7b097d9dffd60a005c96fdb9758f039 /src/clarktown/matchers
parent94c1c0ca639f55ff9073cb1fdf2ad6015bb6bae1 (diff)
Implement indented code blocks.
Diffstat (limited to 'src/clarktown/matchers')
-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