Been using j2html to create html from Java, working well but I don't understand how to use when I want something like this
<p>The fox ran over the <b>Bridge</b> in the forest</p>
If I do
import static j2html.TagCreator.*;
public class HtmlTest
{
public static void main(String[] args)
{
System.out.println(p("The fox ran over the " + b(" the bridge") + "in the forest"));
}
}
I get
<p>The fox ran over the <b>the bridge</b> in the forest</p>
i.e it treats bold as just text.
Note simply doing
import static j2html.TagCreator.*;
public class HtmlTest
{
public static void main(String[] args)
{
System.out.println(p(b("the bridge")));
}
}
does render properly giving
<p><b>the bridge</b></p>