cljsinfo / cljs.info

ClojureScript website
http://cljs.info
MIT License
96 stars 9 forks source link

encode special characters in symbol names for doc pages #54

Closed shaunlebron closed 9 years ago

shaunlebron commented 9 years ago

clojuredocs encodes symbols like this for their URLs, like coll_q instead of coll?: source

(defn cd-encode [s]
  (when s
    (cond
      (= "." s) "_."
      (= ".." s) "_.."
      :else (-> s
                (str/replace #"/" "_fs")
                (str/replace #"\\" "_bs")
                (str/replace #"\?" "_q")))))
oakmac commented 9 years ago

https://github.com/oakmac/cljs.info/blob/37c801aff98b115362e811cc7a53df6d4749fe15/cljs-server/cljsinfo_server/core.cljs#L34-L44