lambdaisland / hiccup

Enlive-backed Hiccup implementation (clj-only)
Mozilla Public License 2.0
28 stars 4 forks source link

Update instruction on how to insert pre-rendered HTML #1

Closed justindbelanger closed 1 year ago

justindbelanger commented 2 years ago

The README demonstrates how to insert pre-rendered HTML using the keyword ::hiccup/raw, which only works in an older revision of the code. The newest version supports the keyword ::hiccup/unsafe-html instead, so I've updated the README to use that.

justindbelanger commented 2 years ago

I was looking at the docstrings for the lambdaisland.hiccup namespace and for the render function. Would it be helpful to mention this keyword in either of those places, as well?

alysbrooks commented 2 years ago

@justindbelanger Thanks! This LGTM, but do you want to make the docstring changes in the same PR? The only reason I can think of to not do it is if @plexus has API changes in mind that would invalidate the docstring, but I doubt it.

plexus commented 2 years ago

No, not planning to change this again. I think "unsafe-html" is good to make it clear that if you reach for this that you should know the implications. It also rhymes with react's "dangerouslySetInnerHtml" (IIRC).

So yes, docstring updates would be much appreciated as well. Thanks a lot!

alysbrooks commented 1 year ago

@justindbelanger If you ever want to come back and update the docstrings, that'd be great, but in the meantime, I thought I'd merge this. Thanks!

A tiny cartoon mouse spinning a globe with "thanks" and "thank you!" written in various colors