hiccup icon indicating copy to clipboard operation
hiccup copied to clipboard

Update instruction on how to insert pre-rendered HTML

Open justindbelanger opened this issue 2 years ago • 3 comments

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 avatar Mar 17 '22 18:03 justindbelanger

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?

justindbelanger avatar Mar 17 '22 18:03 justindbelanger

@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.

alysbrooks avatar Mar 18 '22 22:03 alysbrooks

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!

plexus avatar Mar 20 '22 12:03 plexus

@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

alysbrooks avatar Mar 20 '23 15:03 alysbrooks