From 7c3eba77fd3de0e108efba94018233a57e66989e Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Wed, 11 May 2022 20:42:30 +0300 Subject: Implement indented code blocks. --- src/clarktown/matchers/indented_code_block.clj | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/clarktown/matchers/indented_code_block.clj (limited to 'src/clarktown/matchers/indented_code_block.clj') 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 -- cgit v1.2.3