aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Wilberding <[email protected]>2014-03-05 11:03:45 +0100
committerJordan Wilberding <[email protected]>2014-03-05 11:03:45 +0100
commit574047d56f2be6c38952652c1681ee33b8a33ee9 (patch)
tree2220e9c09f52a4ee6c1becba77c2c951f7ec4076
parent7a93d8ff2333984877966a24d033628b147b8686 (diff)
parent72181ce8c5534f8e8fd20202c33a0d33c72e5758 (diff)
downloadrelx-574047d56f2be6c38952652c1681ee33b8a33ee9.tar.gz
relx-574047d56f2be6c38952652c1681ee33b8a33ee9.tar.bz2
relx-574047d56f2be6c38952652c1681ee33b8a33ee9.zip
Merge pull request #132 from puzza007/erlydtl-auto-escape-false
Set auto_escape to false for erlydtl compilation
-rw-r--r--src/rlx_prv_overlay.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rlx_prv_overlay.erl b/src/rlx_prv_overlay.erl
index c8c8f16..882c67e 100644
--- a/src/rlx_prv_overlay.erl
+++ b/src/rlx_prv_overlay.erl
@@ -30,6 +30,8 @@
-define(DIRECTORY_RE, ".*(\/|\\\\)$").
+-define(ERLYDTL_COMPILE_OPTS, [report_warnings, return_errors, {auto_escape, false}]).
+
-include("relx.hrl").
%%============================================================================
@@ -281,7 +283,7 @@ handle_errors(State, Result) ->
{ok, rlx_state:t()} | relx:error().
do_individual_overlay(State, OverlayVars, {mkdir, Dir}) ->
ModuleName = make_template_name("rlx_mkdir_template", Dir),
- case erlydtl:compile(erlang:iolist_to_binary(Dir), ModuleName, [report_warnings, return_errors]) of
+ case erlydtl:compile(erlang:iolist_to_binary(Dir), ModuleName, ?ERLYDTL_COMPILE_OPTS) of
{ok, ModuleName} ->
case render(ModuleName, OverlayVars) of
{ok, IoList} ->
@@ -380,7 +382,7 @@ is_directory(ToFile0, ToFile1) ->
ok | relx:error().
render_template(OverlayVars, Data) ->
TemplateName = make_template_name("rlx_template_renderer", Data),
- case erlydtl:compile(Data, TemplateName, [report_warnings, return_errors]) of
+ case erlydtl:compile(Data, TemplateName, ?ERLYDTL_COMPILE_OPTS) of
Good when Good =:= ok; Good =:= {ok, TemplateName} ->
case render(TemplateName, OverlayVars) of
{ok, IoData} ->
@@ -416,7 +418,7 @@ write_template(OverlayVars, FromFile, ToFile) ->
fun((term()) -> {ok, rlx_state:t()} | relx:error())) ->
{ok, rlx_state:t()} | relx:error().
file_render_do(OverlayVars, Data, TemplateName, NextAction) ->
- case erlydtl:compile(erlang:iolist_to_binary(Data), TemplateName, [report_warnings, return_errors]) of
+ case erlydtl:compile(erlang:iolist_to_binary(Data), TemplateName, ?ERLYDTL_COMPILE_OPTS) of
{ok, TemplateName} ->
case render(TemplateName, OverlayVars) of
{ok, IoList} ->