Escaping handlebars

Previous Next

In some cases you need to be able to preserve the handlebar notation in the HTML that is generated.

Such a situation arises, for example, in combination with attributes. Consider a ButtonControl with the following setting for its title attribute (an Extra HTML Attributes property):

title="Submit (Alt+S)"

USoft will generate the following HTML:

<button data-lang-title="Submit (Alt+S)" title="Submit (Alt+S)"> </button>

An available translation for ‘Submit’ will not be used in this case because the key string is ‘Submit (Alt+S)’. The mnemonic part of the string is static and does not have to be part of the key string. This can be in the following way (pay attention to the combination of ‘{‘ and ‘[‘):

title="{["Submit"]} (Alt+S)"

USoft will generate the following HTML:

<button data-lang-title="{{"Submit"}} (Alt+S)" title="Submit (Alt+S)"> </button>