diff options
| author | Asko Nõmm <ano@ano.ee> | 2022-04-30 12:09:32 +0300 |
|---|---|---|
| committer | Asko Nõmm <ano@ano.ee> | 2022-04-30 12:09:32 +0300 |
| commit | ee7ab7fd1163a1a8444e16017793eb32a0eb08ee (patch) | |
| tree | 287468b35b2815a7164225883669e070bde39b63 /src/clarktown/matchers | |
| parent | 258fda339e9a5bf3b2cfc2f8dea28c4c02b28073 (diff) | |
Close #22, Close #23
Diffstat (limited to 'src/clarktown/matchers')
| -rw-r--r-- | src/clarktown/matchers/heading_block.clj | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/clarktown/matchers/heading_block.clj b/src/clarktown/matchers/heading_block.clj index 2295f26..1a9a451 100644 --- a/src/clarktown/matchers/heading_block.clj +++ b/src/clarktown/matchers/heading_block.clj @@ -6,9 +6,7 @@ (defn is-atx-heading? "Determines whether the given block is a atx heading." [block] - (-> (string/replace block #"\n" "") - string/trim - (string/starts-with? "#"))) + (re-matches #"^\#{1,6}\s.*" block)) (defn is-settext-heading? @@ -26,4 +24,4 @@ "Determines whether the given block is a heading block." [block] (or (is-atx-heading? block) - (is-settext-heading? block)))
\ No newline at end of file + (is-settext-heading? block))) |
