From 071921fc1547e61d450004298bf5402c00ca20c6 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Wed, 16 Oct 2019 10:51:39 -0400 Subject: [PATCH 1/2] Bump bbmustache --- rebar.config | 2 +- rebar.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rebar.config b/rebar.config index 6ffdfd59..f28a721c 100644 --- a/rebar.config +++ b/rebar.config @@ -7,7 +7,7 @@ {parse_trans, "3.3.0"}, % force otp-21 compat {providers, "1.8.1"}, {getopt, "1.0.1"}, - {bbmustache, "1.6.1"}, + {bbmustache, "1.8.0"}, {relx, "3.33.0"}, {cf, "0.2.2"}, {cth_readable, "1.4.6"}, diff --git a/rebar.lock b/rebar.lock index 0322a6c6..40488af3 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,5 +1,5 @@ {"1.1.0", -[{<<"bbmustache">>,{pkg,<<"bbmustache">>,<<"1.6.1">>},0}, +[{<<"bbmustache">>,{pkg,<<"bbmustache">>,<<"1.8.0">>},0}, {<<"certifi">>,{pkg,<<"certifi">>,<<"2.5.1">>},0}, {<<"cf">>,{pkg,<<"cf">>,<<"0.2.2">>},0}, {<<"cth_readable">>,{pkg,<<"cth_readable">>,<<"1.4.6">>},0}, @@ -12,7 +12,7 @@ {<<"ssl_verify_fun">>,{pkg,<<"ssl_verify_fun">>,<<"1.1.5">>},0}]}. [ {pkg_hash,[ - {<<"bbmustache">>, <<"9FB63FA60BD53AFBF47F02E6D8BD6B2BEAFC068E02E20975254DC7461FD4F397">>}, + {<<"bbmustache">>, <<"A268D256B3D5C7CF9FD14ECED58977BC71AADB7CE412E883C3A2CD0A10F3CF27">>}, {<<"certifi">>, <<"867CE347F7C7D78563450A18A6A28A8090331E77FA02380B4A21962A65D36EE5">>}, {<<"cf">>, <<"7F2913FFF90ABCABD0F489896CFEB0B0674F6C8DF6C10B17A83175448029896C">>}, {<<"cth_readable">>, <<"29DF6430584389B30D14B7D68D0EB7BC837ED31E2DF6E9D93598D4EC63B1E3BD">>}, From fe8626ff7de635cc84da61b8b3deb553fe9572c9 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Wed, 16 Oct 2019 10:51:48 -0400 Subject: [PATCH 2/2] Disable HTML escaping in Erlang file templating We never really need that and nobody would expect it either. We're rendering normal files, not HTML. --- src/rebar_templater.erl | 9 ++++++--- test/rebar_new_SUITE.erl | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/rebar_templater.erl b/src/rebar_templater.erl index f74b12f9..7266f44e 100644 --- a/src/rebar_templater.erl +++ b/src/rebar_templater.erl @@ -431,8 +431,11 @@ write_file(Output, Data, Force) -> {error, exists} end. -%% %% Render a binary to a string, using mustache and the specified context -%% render(Bin, Context) -> - bbmustache:render(rebar_utils:to_binary(Bin), Context, [{key_type, atom}]). + bbmustache:render( + rebar_utils:to_binary(Bin), + Context, + [{key_type, atom}, + {escape_fun, fun(X) -> X end}] % disable HTML-style escaping + ). diff --git a/test/rebar_new_SUITE.erl b/test/rebar_new_SUITE.erl index 1971be68..3c8ff982 100644 --- a/test/rebar_new_SUITE.erl +++ b/test/rebar_new_SUITE.erl @@ -56,12 +56,12 @@ app_git_user(Config) -> Name = ?config(name, Config), rebar_test_utils:run_and_check( Config, [], - ["new", "test_app", Name, "author_name=some_name"], + ["new", "test_app", Name, "author_name="], {ok, []} ), validate_files( Config, Name, - [{"LICENSE", ["some_name", "git@email.com"]}, + [{"LICENSE", ["", "git@email.com"]}, {"README.md", [Name]}, {".gitignore", []}, {"rebar.config", []},