diff --git a/src/cryogen_core/markup.clj b/src/cryogen_core/markup.clj
index 1bff084..7b44ae7 100644
--- a/src/cryogen_core/markup.clj
+++ b/src/cryogen_core/markup.clj
@@ -17,9 +17,14 @@
"Injects the blog prefix in front of any local links
ex. becomes "
+ [blog-prefix text]
+ (clojure.string/replace text #"href=.?/|src=.?/" #(str (subs % 0 (dec (count %))) blog-prefix "/")))
+
+(defn- rewrite-hrefs-transformer
+ "A :replacement-transformer for use in markdown.core that will inject the
+ given blog prefix in front of local links."
[{:keys [blog-prefix]} text state]
- [(clojure.string/replace text #"href=.?/|src=.?/" #(str (subs % 0 (dec (count %))) blog-prefix "/"))
- state])
+ [(rewrite-hrefs blog-prefix text) state])
(defn- markdown
"Returns a Markdown (https://daringfireball.net/projects/markdown/)