Permalink
Browse files

Handle dashes in cljs names

  • Loading branch information...
1 parent 62d587a commit a2ec19c39f39e6f36fac747f8115b65445bfbaa5 @zk committed Mar 11, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/clj/nsfw/app.clj
View
@@ -10,6 +10,11 @@
[nsfw.util :as nu]
[clojure.string :as str]))
+(defn clj->js-name [s]
+ (-> s
+ str
+ (str/replace #"-" "_")))
+
(defn cs-route [opts]
(fn [r]
(let [{:keys [entry title data css google-maps js]} opts
@@ -21,7 +26,8 @@
entry-ns (first (str/split (str entry) #"/"))
entry-js (->> (str/split (str entry) #"/")
(interpose ".")
- (apply str))]
+ (apply str)
+ clj->js-name)]
{:headers {"Content-Type" "text/html"}
:body (html/html5
[:head

0 comments on commit a2ec19c

Please sign in to comment.