From ee7ab7fd1163a1a8444e16017793eb32a0eb08ee Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Sat, 30 Apr 2022 12:09:32 +0300 Subject: Close #22, Close #23 --- src/clarktown/correctors/atx_heading_block.clj | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/clarktown/correctors/atx_heading_block.clj') diff --git a/src/clarktown/correctors/atx_heading_block.clj b/src/clarktown/correctors/atx_heading_block.clj index 8246ec3..a2a948b 100644 --- a/src/clarktown/correctors/atx_heading_block.clj +++ b/src/clarktown/correctors/atx_heading_block.clj @@ -1,6 +1,7 @@ (ns clarktown.correctors.atx-heading-block (:require - [clojure.string :as string])) + [clojure.string :as string] + [clarktown.matchers.heading-block :refer [is-atx-heading?]])) (defn- in-code-block? @@ -19,12 +20,12 @@ there's no empty newline above, we need to create one, and so this function must then return `true`." [lines line index] - (and (is-atx-heading? line) + (and (is-atx-heading? (string/trim line)) (> index 0) (not (= (-> (nth lines (- index 1)) string/trim) "")) - (not (in-code-block? lines index)))) - + (not (in-code-block? lines index)))) + (defn empty-line-below? "Determines whether there's a need for an empty new line -- cgit v1.2.3