summaryrefslogtreecommitdiff
path: root/src/clarktown
diff options
context:
space:
mode:
Diffstat (limited to 'src/clarktown')
-rw-r--r--src/clarktown/correctors/code_block.clj16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/clarktown/correctors/code_block.clj b/src/clarktown/correctors/code_block.clj
index fcda19b..9b2f0f3 100644
--- a/src/clarktown/correctors/code_block.clj
+++ b/src/clarktown/correctors/code_block.clj
@@ -5,14 +5,14 @@
(defn empty-line-above?
[lines line index]
- (let [occurences (->> (take index lines)
- (filter #(string/starts-with? (string/trim %) "```"))
- count)]
- (and (string/starts-with? (string/trim line) "```")
- (> index 0)
- (even? occurences)
- (not (= (-> (nth lines (- index 1))
- string/trim) "")))))
+ (and (string/starts-with? (string/trim line) "```")
+ (> index 0)
+ (->> (take index lines)
+ (filter #(string/starts-with? (string/trim %) "```"))
+ count
+ even?)
+ (not (= (-> (nth lines (- index 1))
+ string/trim) ""))))
(defn empty-line-below?