Options modify an expression. The @ symbol starts the options part, and each option can take a value, which may be a variable or a literal. Options are mainly used for string formatting, internationalization and joining arrays.
String formatting
${'Page {0} of {1}' @ format=[current, total]}
Internationalization
${'Page' @ i18n, hint='Direction for translators', source='user'}
Array join
${['1', '2'] @ join='; '}
Display context
HTL detects the context of each expression automatically and escapes it accordingly, which keeps output secure and prevents XSS. When your code needs different behaviour, you can set the context explicitly to override the automatic one. The display context refers to the expression's location within the structure of the HTML page.
The available display contexts are:
texthtmlattributeurinumberattributeNameelementNamescriptTokenscriptStringscriptCommentstyleTokenstyleStringstyleCommentunsafe
<!--/* Safely output the markup */-->
${properties.richText @ context='html'}