Version: 7.x.x

autoEscaping

Auto-Escaping is an important feature of Squirrelly. When it's enabled, every reference without the safe filter will be HTML-escaped, to provide some protection against XSS.

warning

Squirrelly has not been vetted for security, and autoEscaping is probably not completely foolproof. We use the same function as many other template engines, like Mustache and Handlebars, but there's still the possibility that there's some vulnerability.

Sqrl.autoEscaping(true) // Turns autoEscaping on
Sqrl.autoEscaping(false) // Turns autoEscaping off
// autoEscaping is on by default
note

To avoid escaping a specific reference, you can pass it through the safe filter. Example: {{{someref | safe}}}

note

Auto-escaping can be helpful, but it also negatively impacts performance. For best results, autoEscape data before you store it or attempt to render it in a template.