I want this to output
What\'s up?
But I get an
maybe use htm ascii code : '
'
<h1 th:text="${'What's up?'}"></h1>
To escape a single quote you just escape it with a \'
\'
<p th:text="'What\'s up?'"></p> <p th:text="${myVar} + 'What\'s up?'"></p>
Double single quote. Like this:
<h1 th:text="${'What''s up?'}" />