weavejester / hiccup

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

Fix literal child elements being escaped #207

Closed luontola closed 6 months ago

luontola commented 7 months ago

Fixes (html [(identity :p) [:span "x"]]) producing "<p>&lt;span&gt;x&lt;/span&gt;</p>" instead of "<p><span>x</span></p>"

I also noticed that element-compile-strategy returned ::default, but compile-element used :default (the default dispatching value for multimethods). Now they both use the same dispatching value.

luontola commented 7 months ago

@weavejester Do you have time to look through this and my other PR?

weavejester commented 7 months ago

Apologies for the delay; I've been traveling. This PR looks good. I split out the :default -> ::default change into its own small commit, just to keep this one clean. Can you rebase and change the commit message to:

Fix literal child elements being escaped

Fix a form like:
    (html [(identity :p) [:span "x"]])

Evaluating to:
    "<p>&lt;span&gt;x&lt;/span&gt;</p>"

Instead of:
    "<p><span>x</span></p>"

The commit messages use plaintext rather than markdown, so this makes it a little easier to read.

luontola commented 7 months ago

Changes done.

luontola commented 6 months ago

@weavejester ping

weavejester commented 6 months ago

This all looks good. Again, apologies for the delay - I only got back home yesterday so my time for open source work over the holidays has been limited.