Avoiding HTML encoding in function return values
Last updated
Last updated
By default the handlebars engine will HTML escape every value it returns into the template.
What this means is that if the value returned from any function contains one of the HTML special characters, then they will be replaced with their escaped equivalent.
Character | Description | Escaped Equivalent |
---|---|---|
In order to avoid this behavior, you need to enclose the function in triple handlebar syntax.
for example:
might return
where as, if used with triple handlebars:
might return
&
Ampersand
&
<
Less than
<
>
Greater than
>
"
Double quote
"
'
Single quote
'
or '
©
Copyright symbol
©
®
Registered symbol
®
™
Trademark symbol
™