Closed afarber closed 3 years ago
I am also facing similar issue, I want to add × HTML characters like this. How to do that ?
Also while using javascript we are facing same issue. withText("var element = document.createElement('a');")
this gets rendered as var element = document.createElement('a');
To prevent any escaping use rawHtml()
.
Examples:
script(rawHtml(vars))
script().with(rawHtml("var element = document.createElement('a');"))
PR #181 has been merged. Now any String parameters for the TagCreator.script(...)
or TagCreator.style(...)
methods will be treated as unescaped text.
Hello, I am using j2html 1.4.0 to generate a web page with some global JavaScript variables:
but unfortunately single quotes are escaped in the resulting output:
How to handle this case please? I would like to use global vars (yes, I know that this is not the cleanest way) to localize and configure my Javascript.
Thank you Alex