Fork me on GitHub
#rum
<
2022-12-30
>
DenisMc09:12:16

Hi, (hopefully) simple question about using rum. I am converting a pre-existing website template to hiccup, and using rum to render. This template has some embedded js used to control the style, for example in the header it contains markup like this:

[:header {:x-data  "{\n          navbarOpen: false,\n          dropdownOpen: false\n        }",
                                      :class  "scrolledFromTop ? 'bg-white dark:bg-dark bg-opacity-80 dark:bg-opacity-80 shadow-sticky backdrop-blur-sm' : 'bg-white dark:bg-dark' ",
                                      ::class "w-full flex items-center sticky top-0 z-50 wow fadeInUp", :data-wow-delay ".2s"} ...
Now, when this is rendered by rum the single quotes (see scrolledFromTop? _'_ ) are escaped - I don’t want them escaped, I want this markup to be left as-is. I’ve seen dangerouslySetInnerHTML, but I only want to ‘dangerously set’ inner html in a couple of places within the header, there are numerous other tags within the header that I want to be transformed as normal from hiccup. I presume there’s a simple way to accomplish this? Thanks in advance.