This is what happens when I try to use a colon in th:text
:
and a backslash doesn't seem to fix it:
How can I use the colon symbol in th:text
?
If you want to place a literal into th:text
, you have to use single quotes: th:text="'7:00AM'"
. See documentation here.
(By contrast, something like this th:text="7_00AM"
is valid - because it is a literal token. Such strings can only use a subset of characters, but do not need enclosing '
s.)