weavejester / hiccup

Fast library for rendering HTML in Clojure
http://weavejester.github.io/hiccup
Eclipse Public License 1.0
2.68k stars 174 forks source link

Properly handle keywords for style map values #159

Closed metasoarous closed 2 years ago

metasoarous commented 5 years ago

It looks from #80 (and some repl tinkering) like keywords generally get cast correctly. However, I've found that for style attributes, the conversion does not work. For example,

=> (hiccup/html [:div {:style {:display :none}} [:p :Hello]])
"<div style=\"display::none;\"><p>Hello</p></div>"

Note that Reagent does handle this properly. I think it would be nice to maintain parity, as it can lead to gotchas when you're rendering the code in both contents (as I do with Oz). It also seems to me that this behavior would make hiccup more consistent with itself, as anywhere else I tested (including as top-level attr maps values), it processed correctly.

Thanks for your work!

weavejester commented 5 years ago

This sounds a reasonable change.

davidperrenoud commented 5 years ago

Related: https://github.com/weavejester/hiccup/pull/140

weavejester commented 2 years ago

Closed by #194.