Skip to content

Added raise_on_context_miss and escape_fun options

Compare
Choose a tag to compare
@soranoba soranoba released this 16 Aug 16:15
· 101 commits to master since this release

New Feature

  • #16 Added escape_fun option
    • You can disable escaping or specify your own escape.
1> bbmustache:render(<<"{{tag}}">>, [{"tag", "<b>value</b>"}], [{escape_fun, fun(X) -> <<"==>", X/binary, "<==">> end}])).
<<"==><b>value</b><==">>
2> bbmustache:render(<<"{{tag}}">>, [{"tag", "<b>value</b>"}], [{escape_fun, fun(X) -> X end}])).
<<"<b>value</b>">>
  • #21 Added raise_on_context_miss option
1> bbmustache:render(<<"{{#parent}}{{child}}{{/parent}}">>, [{"parent", true}], [raise_on_context_miss]).
** exception error: {context_missing,{key,<<"child">>}}

Bug Fixes