escapeHtml - pfaciana/latte-js GitHub Wiki

Latte.prototype.escapeHtml

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

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

var t = new Latte('{$bold}', { escapeHtml: true }); //... or set for this instance only, overrides Latte.prototype.escapeHtml

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

Output:

&lt;b&gt;test&lt;/b&gt;

Older versions of Latte below 3.0.0. please read (https://github.com/pfaciana/latte-js/wiki/escape_html)[https://github.com/pfaciana/latte-js/wiki/escape_html]

⚠️ **GitHub.com Fallback** ⚠️