In my HTML I'm using paragraph that gets content by calling method via thymeleaf:
<p data-th-text="${fund.formatDescription()}"></p>
Method:
private String description;
public String formatDescription() {
return description.replace(";", " \n ");
}
I want my description to have end lines in palce of every semicolon. So that's why I added \n
. But thymeleaf ingores new lines and returns continuous text. I tried adding <br/>
but it ends up not interpreted as html. What should I add in place of semicolon to force new line in the description?
` the / of self-closing tags is always at the end. – litelite May 15 '17 at 19:18
` it's just a typo in the question. – Michael Dz May 15 '17 at 19:42