auto_literal - pfaciana/latte-js GitHub Wiki

Latte.prototype.auto_literal

The Smarty delimiters (default { and } ) will be ignored so long as there are one or more whitespace symbols after left delimiter or one or more whitespace symbols before right delimiter. This behavior can be disabled by setting Latte.prototype.auto_literal to false.

<script>

    Latte.prototype.auto_literal = false;

    var tpl = new Latte(' { $foo } ', { autoLiteral: false }); // Or pass locally which overrides Latte.prototype.auto_literal

    tpl.fetch({foo:'bar'});  //will return ' bar '

</script>

see also Escaping Smarty Parsing in PHP Smarty documentation

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