summaryrefslogtreecommitdiff
path: root/src/clarktown/matchers/heading_block.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/clarktown/matchers/heading_block.clj')
-rw-r--r--src/clarktown/matchers/heading_block.clj6
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)))