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.
This commit is contained in:
parent
839ed5c469
commit
792833facb
1 changed files with 2 additions and 2 deletions
|
@ -16,8 +16,8 @@
|
||||||
"Injects the blog prefix in front of any local links
|
"Injects the blog prefix in front of any local links
|
||||||
ex. <img src='/img/cryogen.png'/> becomes <img src='/blog/img/cryogen.png'/>"
|
ex. <img src='/img/cryogen.png'/> becomes <img src='/blog/img/cryogen.png'/>"
|
||||||
[blog-prefix text]
|
[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 "/"))))
|
(clojure.string/replace text #"href=.?/|src=.?/" #(str (subs % 0 (dec (count %))) blog-prefix "/"))))
|
||||||
|
|
||||||
(defn markups
|
(defn markups
|
||||||
|
|
Loading…
Reference in a new issue