Thymeleaf. Render text with HTML tags in HTML

0

I'm using TINYMCE so that in a form with a textarea the user can give some styles to the text. In this way in my database this field is saved, for example, in the following way.

<p><strong>Some description goes here...</strong></p> 

The issue is that when you show it on a page it looks like that, and what I need is that you do not see the tags and you see the formatted / rendered text like here

Some description goes here ...

I have tried with the tags <pre> and <code> but they do not give me the results I need.

I'm using Thymeleaf with Spring framework. In the IDE I am trying to show the description in the following way

<article th:text="${product.description}"></article>

Thanks in advance.

    
asked by Lucas. D 12.05.2018 в 23:48
source

1 answer

1

Try printing with unescaped text , something like this:

<article th:utext="${product.description}"></article>

th:text would be the one that is converting you tags to entities

ref. link

    
answered by 13.05.2018 / 17:58
source