escape_html - pfaciana/latte-js GitHub Wiki

Latte.prototype.escape_html

Escape HTML markup in template variables. By default is false (don't escape HTML).

Latte.prototype.escape_html = true;  //set global for all Latte instances

var t = new Latte('{$bold}');

t.escape_html = true;  //... or set for this instance only, overrides Latte.prototype.escape_html

t.fetch({bold: '<b>test</b>'});

Output:

&lt;b&gt;test&lt;/b&gt;
⚠️ **GitHub.com Fallback** ⚠️