Skip to content

Releases: soranoba/bbmustache

Fix that the processing does not complete, when target of partial does not exist

15 Aug 06:45
8ad09ad
Compare
Choose a tag to compare

New features

  • Added new option is raise_on_partial_miss at bbmustache:parse_option() #27
  • bbmustache:option() split into bbmustache:parse_option(), bbmustache:compile_option(), bbmustache:render_option().

Bug fix

  • Fix that the processing does not complete, when target of partial does not exist #27

More information

  • bbmustache:option() is deprecated. #27
  • officially support OTP21 #25
  • officially deprecated R16 #25
  • Fix comment of document #23

Added raise_on_context_miss and escape_fun options

16 Aug 16:15
Compare
Choose a tag to compare

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

Support the context stack

27 Oct 16:34
Compare
Choose a tag to compare

e.g.

1> Map = #{"a" => #{"one" => 1}, 
1>         "b" => #{"two" => 2},
1>         "c" => #{"three" => 3}}.
#{"a" => #{"one" => 1},"b" => #{"two" => 2},"c" => #{"three" => 3}}
2> Template = <<"{{#a}}"
2>              "{{one}}"
2>              "{{#b}}"
2>              "{{one}}{{two}}{{c.three}}"
2>              "{{/b}}"
2>              "{{/a}}">>.
<<"{{#a}}{{one}}{{#b}}{{one}}{{two}}{{c.three}}{{/b}}{{/a}}">>
3> bbmustache:render(Template, Map).
<<"1123">>

See also:
#17
https://github.com/mustache/spec/blob/v1.1.3/specs/sections.yml#L56-L93

FIX it isn't sometimes escape.

25 Oct 15:45
Compare
Choose a tag to compare

e.g.

% v1.3.0
1> bbmustache:render(<<"{{{message}}world}">>, #{"message"=>"<s>hello</s>"}).  
<<"{<s>hello</s>world}">>

% v1.3.1
2> bbmustache:render(<<"{{{message}}world}">>, #{"message"=>"<s>hello</s>"}).  
<<"{&lt;s&gt;hello&lt;/s&gt;, }">>

Performance improvements and some fixes

17 Sep 09:47
Compare
Choose a tag to compare
  • About 1.6 times will be faster.
  • Since the intermediate format is changed, please do NOT update with hot code.
    • The interface isn't change.

New features

  • Support the delimiter that is three or more characters.

Bug fix

Additions and fixes for the mustache specs.

26 Aug 12:02
Compare
Choose a tag to compare
  • Support the dotted names. (child's variables)
  • Support the recursive partials.
  • Support the indent in partials.
  • Change the escape characters. #13
  • Reset the delimiters in the partial sections.
  • If the tag including the space has been specified, it became to delete the space.
  • Change of the processing of the new line.
  • Support the proplist that include empty tuple : [{}]

You can find the change logs with more detailed info at: #14

Support for rendering plain lists.

01 Jan 14:31
Compare
Choose a tag to compare
  • support for rendering plain lists.
  • add http escaping chars
    • please refer to here

Library name was changed "mustache" into "bbmustache"

21 Jun 04:21
Compare
Choose a tag to compare
  • mustache.erl -> bbmustache.erl
    • All function is not changed.
  • If you want to use mustache.erl yet, please use the v0.3.3 (but this is not supported)

It support atom and binary as key.

08 May 18:33
Compare
Choose a tag to compare

It support atom and binary as key.
And, it support atom as value.

issue and pr:
#2 #4 #5

It supports assoc list in addition to maps

08 May 18:36
Compare
Choose a tag to compare
v0.2.0

Merge remote-tracking branch 'origin/feature/support-assoc-list'