You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to (programmatically) highlight the dynamic values (context variables) of a thymeleaf template, by say wrapping each one of them in a span and applying a yellow background.
For example, this thymeleaf:
The surrounding span with the background is what I would like to have automatically inserted around every printed variable.
Changing the values themselves (to add the wrapping span) doesn't work because the values can be used in conditionals within the template, so changing values can alter what those conditionals evaluate to.
Search and replace can yield false postives because dynamic values can also organically occur in the template.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I would like to (programmatically) highlight the dynamic values (context variables) of a thymeleaf template, by say wrapping each one of them in a span and applying a yellow background.
For example, this thymeleaf:
executed with context:
should output:
The surrounding span with the background is what I would like to have automatically inserted around every printed variable.
Changing the values themselves (to add the wrapping span) doesn't work because the values can be used in conditionals within the template, so changing values can alter what those conditionals evaluate to.
Search and replace can yield false postives because dynamic values can also organically occur in the template.
How can I achieve this?
Beta Was this translation helpful? Give feedback.
All reactions