summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsko Nõmm <ano@ano.ee>2022-04-30 00:00:53 +0300
committerAsko Nõmm <ano@ano.ee>2022-04-30 00:00:53 +0300
commit258fda339e9a5bf3b2cfc2f8dea28c4c02b28073 (patch)
treea5f80c267082bdd9094b7ecbd183c7fcb17d3ceb
parentd6e39c016e16b60b85b60898e93eda8d2c6f00db (diff)
Use ATX matcher to identify block
-rw-r--r--src/clarktown/correctors/atx_heading_block.clj4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/clarktown/correctors/atx_heading_block.clj b/src/clarktown/correctors/atx_heading_block.clj
index 361b9b9..8246ec3 100644
--- a/src/clarktown/correctors/atx_heading_block.clj
+++ b/src/clarktown/correctors/atx_heading_block.clj
@@ -19,7 +19,7 @@
there's no empty newline above, we need to create one, and
so this function must then return `true`."
[lines line index]
- (and (string/starts-with? (string/trim line) "#")
+ (and (is-atx-heading? line)
(> index 0)
(not (= (-> (nth lines (- index 1))
string/trim) ""))
@@ -33,7 +33,7 @@
there's no empty newline below, we need to create one, and
so this function must then return `true`."
[lines line index]
- (and (string/starts-with? (string/trim line) "#")
+ (and (is-atx-heading? line)
(< index (- (count lines) 1))
(not (= (-> (nth lines (+ index 1))
string/trim) ""))