From e76d81f16ac295cf6ac26218b57bbdff4aac6e6e Mon Sep 17 00:00:00 2001 From: Dan Holmsand Date: Mon, 10 Feb 2014 09:12:29 +0100 Subject: [PATCH] Allow e.g dangerously-set-inner-HTML --- src/reagent/impl/template.cljs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/reagent/impl/template.cljs b/src/reagent/impl/template.cljs index 61408f5..4ed3419 100644 --- a/src/reagent/impl/template.cljs +++ b/src/reagent/impl/template.cljs @@ -15,6 +15,11 @@ (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] (if (string? dashed) dashed @@ -22,7 +27,7 @@ [start & parts] (string/split name-str #"-")] (if (dont-camel-case start) name-str - (apply str start (map string/capitalize parts)))))) + (apply str start (map capitalize parts)))))) (def attr-aliases {:class "className" :for "htmlFor"