Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow disabling of html escaping #16

Closed
lrascao opened this issue Oct 14, 2016 · 5 comments
Closed

Allow disabling of html escaping #16

lrascao opened this issue Oct 14, 2016 · 5 comments
Milestone

Comments

@lrascao
Copy link

lrascao commented Oct 14, 2016

This is a rehash of #10, as i'm sure you're aware, bbmustache is being used in relx to template scripts and overlay vars, in this context we don't really need html escaping and it would be useful to disable it completely, this way users wouldn't have to use the {{{ syntax to escape binary values in overlays variables for example.

@soranoba
Copy link
Owner

I understand these.
However, bbmustache is a mutache library. So, "{{ }}" means html escape.
This can not be changed.

If relx use 1.3.x from 1.0.x, you can be the overwrite in the following way.
But, this method does not mean support forever.

1> bbmustache:render(<<"{{hoge}}">>, #{"hoge" => "<s>hoge</s>"}).         
<<"&lt;s&gt;hoge&lt;/s&gt;">>
2> bbmustache:render(<<"{{={ }=}}{{hoge}}">>, #{"hoge" => "<s>hoge</s>"}).
<<"<s>hoge</s>">>

@soranoba
Copy link
Owner

NOTE:
Although I am preparing the next release in the branch of the 1.3.x.
Now, this feature is not available on the branch.

@soranoba soranoba added this to the v1.5.0 milestone Aug 15, 2017
@soranoba
Copy link
Owner

It will add this in v1.5.0, because equivalent function exist in mustache.rb.

{escape_fun, fun((binary()) -> binary())}

I plan to add escape_fun to option.

@lrascao
Copy link
Author

lrascao commented Aug 16, 2017

👍

@soranoba
Copy link
Owner

This feature was added in v1.5.0.
Please refer to https://github.com/soranoba/bbmustache/releases/tag/v1.5.0

chris-franklin-hpe added a commit to Plexxi/bbmustache that referenced this issue Mar 5, 2019
* master:
  Add frequently asked content in README / fix typos.
  version bump
  Fix typo, write officially support version at doc.
  related soranoba#28 : modified some typespecs
  resolve soranoba#28 : Fix incompatible typespecs of some options
  update some docs
  version bump
  Fixed degrade that it was possible to read the same file multiple times.
  Become to support raise_on_partial_miss. option() become to deprecated.
  FIX: If there are templates that do not exist, parse does not end...
  unsupport R16
  update newest rebar3
  update rebar.config, rebar3, travis.yml with otp21
  Fix a simple typo in document and comment (contex -> context)
  version bump
  resolve soranoba#16 (customize escape)
  Add some tests and Update some tests
  resolve soranoba#21 soranoba#22 (Supprt raise_on_context_miss option)
  replace tab to space
  ADD 20.0 in .travis.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants