tipsy / j2html

Java to HTML generator. Enjoy typesafe HTML generation.

Home Page:https://j2html.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

style() tag html escapes the css code

tfbroner opened this issue · comments

When I do something like :
html(head(title("Test"), style(".testnav>a {}"))).render();
it ends up escaped like :
<html><head><title>Test</title><style>.testnav&gt;a {}</style></head></html>
which makes it invalid css code.

Any ideas as to what I'm doing wrong ?

commented

You could try .rawHtml("<style>...</style>")

Thanks,
I used rawHtml inside the style tag and it worked as well.

PR #181 has been merged. Now any String parameters for the TagCreator.script(...) or TagCreator.style(...) methods will be treated as unescaped text.