Allow e.g dangerously-set-inner-HTML

This commit is contained in:
Dan Holmsand 2014-02-10 09:12:29 +01:00
parent bd1c04e0b3
commit e76d81f16a

View File

@ -15,6 +15,11 @@
(def dont-camel-case #{"aria" "data"}) (def dont-camel-case #{"aria" "data"})
(defn capitalize [s]
(if (< (count s) 2)
(string/upper-case s)
(str (string/upper-case (subs s 0 1)) (subs s 1))))
(defn dash-to-camel [dashed] (defn dash-to-camel [dashed]
(if (string? dashed) (if (string? dashed)
dashed dashed
@ -22,7 +27,7 @@
[start & parts] (string/split name-str #"-")] [start & parts] (string/split name-str #"-")]
(if (dont-camel-case start) (if (dont-camel-case start)
name-str name-str
(apply str start (map string/capitalize parts)))))) (apply str start (map capitalize parts))))))
(def attr-aliases {:class "className" (def attr-aliases {:class "className"
:for "htmlFor" :for "htmlFor"