item.getDisplayLine() returns the following html " /> item.getDisplayLine() returns the following html " /> item.getDisplayLine() returns the following html "/>

thymeleaf utext unescaped html not interpreted by browser

21 views Asked by At

In my following code snippet

<div
   class="item-container"
    th:utext="${item.getDisplayLine()}">
</div>

item.getDisplayLine() returns the following html with span and an inner text. Span has custom css applied to it

<div style="display: inline-block;">5.66</div>/<div style="display: inline-block;"><div style="color: #f44336; transform: rotateX(0) rotateY(0) rotateZ(0) skewX(0) skewY(0)">Some Custom Text</div></div>
                                                   

I can see this correctly if I do view source on browser but the browser does not interpret it. For example the css in included html is not applied, Also the element picker in dev tools shows only the text and does not traverse the complete html, The html seems to be valid.

The behavior is same in ff and chrome. Can any one point me to what could be the reason.

0

There are 0 answers