Thymeleaf: add HTML to th:replace function -
i add html in th:replace function in thymeleaf, so:
<div th:replace="elements/listview :: row (subtext='test<br />test')" ></div>
my 'listview' template this:
<div class="listview-row" th:fragment="row"> <span class="listview-subtext" th:if="${subtext != null}" th:utext="${subtext}"> </span> </div>
it doesn't compile. of course want compile as:
<div class="listview-row"> <span class="listview-subtext"> test<br />test </span> </div>
.. html in place. there way that? thank in advance help.
try this:
<div class="listview-row" th:fragment="row(subtext)"> <span class="listview-subtext" th:if="${subtext != null}" th:utext="${subtext}"> </span> </div>
and use this:
<div th:replace="elements/listview :: row ('test<br />test')" ></div>
Comments
Post a Comment