From 9fae4b6dfabc7485a8a2debf108d8190761590f5 Mon Sep 17 00:00:00 2001 From: Asko Nomm Date: Sat, 9 Apr 2022 19:32:05 +0200 Subject: Fix #8: Links break textual checkboxes --- src/clarktown/parsers/link_and_image.clj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/clarktown/parsers/link_and_image.clj b/src/clarktown/parsers/link_and_image.clj index dd8c9d0..3dbbac7 100644 --- a/src/clarktown/parsers/link_and_image.clj +++ b/src/clarktown/parsers/link_and_image.clj @@ -7,15 +7,15 @@ "Renders all occurring links and images." [block _] (loop [block block - matches (-> (re-seq #"\!?\[(.*?)\]\((.*?)\)" block) + matches (-> (re-seq #"\!?\[(\w+( \w+|\.|\,)*)\]\((.*?)\)" block) distinct)] (if (empty? matches) block - (let [[whole-match label href] (first matches) + (let [[whole-match label _ href] (first matches) image? (string/starts-with? whole-match "!") image (str "\""") link (str "" label "")] (recur (if image? (string/replace block whole-match image) (string/replace block whole-match link)) - (drop 1 matches)))))) + (drop 1 matches)))))) \ No newline at end of file -- cgit v1.2.3