I want this to output
<h1 th:text="${'What\ up?'}"></h1>
<h1>What up?</h1>
But I get it TemplateInputException. I tried with the HTML object, but it does not work.
TemplateInputException
Double single quote. Like this:
<h1 th:text="${'What' up?'}" />
it is possible to use htm ascii code: '
'
<h1 th:text="${'What's up?'}"></h1>
To avoid a single quote, you simply avoid it with \'
\'
<p th:text="'What\ up?'"></p> <p th:text="${myVar} + 'What\ up?'"></p>
Source: https://habr.com/ru/post/1673619/More articles:How to get the value "extract" key from Wikipedia answer JSON - jsonWhy destroy a stream by mistake? - node.jsКак использовать Session_Start в ASP.NET MVC? - c#Undefined form controls - angularFilter Using HBase REST API - restAssigning a value to the readonly property works with a fixed value, but not with a variable - c #Effectively count the number of bits in an integer expression in JavaScript - javascriptHow to use webpack for deployment - webpackHaving problems submitting form data using ajax to controller action (laravel) - jqueryUnable to resubmit job to ml-engine because "Work with this identifier already exists" - tensorflowAll Articles