Browse Source

Merge pull request #117 from tomekowal/fix_escapejs_return_type

Fix escapejs return type
Andreas Stenius 11 years ago
parent
commit
e201eb3ad2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/erlydtl_filters.erl

+ 1 - 1
src/erlydtl_filters.erl

@@ -296,7 +296,7 @@ divisibleby(Input, Divisor) when is_integer(Input), is_integer(Divisor) ->
 
 
 %% @doc Escapes characters for use in JavaScript strings.
 %% @doc Escapes characters for use in JavaScript strings.
 escapejs(Input) when is_binary(Input) ->
 escapejs(Input) when is_binary(Input) ->
-    escapejs(unicode:characters_to_list(Input));
+    unicode:characters_to_binary(escapejs(unicode:characters_to_list(Input)));
 escapejs(Input) when is_list(Input) ->
 escapejs(Input) when is_list(Input) ->
     escapejs(Input, []).
     escapejs(Input, []).