In my Java program, I have a populator with a string that is 2 paragraphs long.
String myString = "Paragraph 1 text... \n" +
"\n" +
"Paragraph 2 text...";
When I display it using Thymeleaf, it displays as 1 paragraph.
"Paragraph 1 text... Paragraph 2 text..."
How do I separate them into paragraphs like so:
"Paragraph 1 text...
Paragraph 2 text..."
Here's the Thymeleaf to display the text:
<section class="post-content" th:text="${post.myString}">
</section>
EDIT:
I have tried using tags (like <p> and <br />) but they get displayed as text and not as html tags.