weavejester / hiccup

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

Use hiccup.util/as-str for attribute sequences #169

Closed kwrooijen closed 2 years ago

kwrooijen commented 4 years ago

Use hiccup.util/as-str for each item in a sequence attribute. This would allow users to extend the hiccup.util/ToString protocol in attributes with a sequence. Which I personally need to render atoms / functions properly. My webpage still renders with this change, and tests didn't break. However I can't say if this change has no impact at all.

weavejester commented 4 years ago

Can you add some tests? e.g. around nil etc.

weavejester commented 4 years ago

Also use to-str as it's more efficient for single values.

kwrooijen commented 4 years ago

Not sure what to test. Since tests for attributes (including a nil attribute) are already included.

weavejester commented 4 years ago

Keywords should be treated differently, right? So a test could be added for those.

weavejester commented 2 years ago

Closed by #195.