escapejson

Escapes the value for insertion in JSON output.

For example:

{{ value|escapejson }}

When the value is he'llo then the output is he\x27llo.

Internally, this calls z_utils:json_escape/1 to perform the escaping.

Edit on GitHub

escapejs Character escaping escapexml

Referred by

escapejs

Escapes the value for insertion in JavaScript output.

Filters

Filters transform template variables before they are rendered.