1

I'm trying to use Icomoon web icon font in a Spring Thymeleaf application. The recommended method is to set a data-icon attribute in an HTML tag. The given css then sets font family to icomoon and content to the value of the data-icon attribute, using the selector [data-icon]:before.

The icons are references by HTML Entity Code (&#xe048 for example).

I guess you've spotted my issue, Thymeleaf templates are XHTML documents. So we got a problem with the ampersand. It is escaped at template rendering to &amp. The icons cannot be rendered this way...

How can I prevent Thymeleaf from escaping it ?

0 Answers0