Th: block and th: remove = "tag" add unwanted spaces

I want to create plain text (without the surrounding tag), but for some reason I get unwanted "white" characters. If i try

<th:span th:text="myText" th:remove="tag">Placeholder text</th:span> 

or

 <th:block th:text="myText">Placeholder text</th:block> 

I get:

 " myText " 

I am not sure if this will affect a single line after I make a recursive call:

 <div th:with="nodelist = ${node.children}" th:include="this::fragmentid" th:remove="tag"></div> 

What can happen?

Thanks in advance.

+5
source share
1 answer

I think you need to use thymeleaf-extras .

+1
source

Source: https://habr.com/ru/post/1236853/


All Articles