commit - d5c213d182a0ba7ad270329db4a6f05332ad05bf
commit + d68cd6bb12892e777f6f04a882de2be09f757741
blob - 95a1fcb4468cec4f86d14e8566743bfe13c7b9f5
blob + bfb54fb821ff4452111e821d37e13b9c5208aae1
--- src/blog/gemtext.clj
+++ src/blog/gemtext.clj
[clojure.string :as str]
[clojure.walk :as walk]))
-(defn- starts-with?
+(defn- starts-with?
"check if `s` starts with `substr`. Return `false` if `s` is not a
string."
[s substr]
(starts-with? line "### ") [:h3 (subs line 4)]
:else line))))))
-(defn- generic-matcher
+(defn- generic-matcher
"Return a generic matcher transducer. Will wrap line that starts with
`start` within `[type line]`."
[start type]
(match-links)
(match-paragraphs)))
-(defn parse
+(defn parse
"Given a string representing a gemtext document, parse it into an
hiccup-like data structure."
[str]
(fn [t]
(cond
(nil? t) nil
-
+
(or (seq? t)
(vector? t))
(if (keyword? (first t))