Reputation: 3439
In a mail I want to display a java variable :
context.setVariable("content", "Hi<br>This is a test<p></p>");
In the mail template I do :
<p><span th:text="|${content}|"></span></p>
In the mail this is converted in :
<p><span>Hi<br>this is a test<p></p></span></p>
How to make the variable well interpretated.
Thank you.
Upvotes: 5
Views: 18280
Reputation: 20487
Use th:utext
instead of th:text
http://www.thymeleaf.org/doc/tutorials/2.1/usingthymeleaf.html#unescaped-text
Upvotes: 13