mirror of
https://github.com/status-im/reagent.git
synced 2025-01-24 10:49:52 +00:00
Allow e.g dangerously-set-inner-HTML
This commit is contained in:
parent
bd1c04e0b3
commit
e76d81f16a
@ -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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user