williamsandonz
williamsandonz

Reputation: 16460

How to create custom bindings syntax for Hogan.js (unescaped HTML version)

I'm currently doing

var compiledHtml = Hogan.compile(templateHtml, { delimiters: '<% %>' });

This works great. But I need to output some HTML, usually I could use mustache default {{{, how can I achieve this with my custom syntax?

Upvotes: 0

Views: 44

Answers (1)

bobthecow
bobthecow

Reputation: 5117

If you're using non-standard delimiters, you should still be able to use & for unescaped tags. This:

<% thing %>
<%& thing %>

Is equivalent to this:

{{ thing }}
{{{ thing }}}

Upvotes: 1

Related Questions