From 792833facb5d2e355089344b210d0ffa0dfc4b9d Mon Sep 17 00:00:00 2001 From: ponkore Date: Sun, 10 Jan 2016 23:40:19 +0900 Subject: [PATCH] rewrite-hrefs bug fix (when :blog-prefix is blank) When :blog-prefix in `config.edn` is set nil or "", rewrite-hrefs should return `text` itself. --- src/cryogen_core/markup.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cryogen_core/markup.clj b/src/cryogen_core/markup.clj index f3c5ea6..69b671c 100644 --- a/src/cryogen_core/markup.clj +++ b/src/cryogen_core/markup.clj @@ -16,8 +16,8 @@ "Injects the blog prefix in front of any local links ex. becomes " [blog-prefix text] - (if-not (s/blank? blog-prefix) - + (if (s/blank? blog-prefix) + text (clojure.string/replace text #"href=.?/|src=.?/" #(str (subs % 0 (dec (count %))) blog-prefix "/")))) (defn markups