Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

th:block and th:remove="tag" adding undesired spaces

Tags:

thymeleaf

I want to generate plain text (without surrounding tag) but for some reason I am getting undesired "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 might affect but one line after I make a recursive call:

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

What might be happening?

Thanks in advance.

like image 251
DiegoSahagun Avatar asked Nov 25 '15 21:11

DiegoSahagun


1 Answers

I think that you need to use thymeleaf-extras for that.

like image 197
juanlumn Avatar answered Oct 22 '22 11:10

juanlumn