From c82ffa6bee61b35197bb96cb4bf753b30e9c8a19 Mon Sep 17 00:00:00 2001 From: Dan Connor Date: Mon, 18 Feb 2013 22:40:48 -0800 Subject: [PATCH] Fix for tunaries always being truthy when passed to escaping EJS tags. The implementation was prepending an empty string blindly to the front of the fragment provided to the tags which caused the turnary to always be evaluated truthily. --- lib/ejs.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ejs.rb b/lib/ejs.rb index 686649a..77c75e9 100644 --- a/lib/ejs.rb +++ b/lib/ejs.rb @@ -69,7 +69,7 @@ def js_unescape!(source) def replace_escape_tags!(source, options) source.gsub!(options[:escape_pattern] || escape_pattern) do - "',(''+#{js_unescape!($1)})#{escape_function},'" + "',(''+(#{js_unescape!($1)}))#{escape_function},'" end end