Fix implementation of escape and money filters

This commit is contained in:
Sam Doiron
2022-04-18 11:22:19 -03:00
parent 8a71d29bfb
commit 7c70b56002
+2 -2
View File
@@ -202,10 +202,10 @@ module Liquid
RUBY
},
"escape" => ->(compiler, expr, args, kwargs) {
"(_t = #{expr}; CGI.escape(_t) unless _t)"
"(_t = #{expr}; CGI.escape(_t) if _t)"
},
"money" => ->(compiler, expr, args, kwargs) {
"(_m = #{expr}; _m.nil? ? '' : \"\#{(_m / 100.0).round(2)}\")"
"(_m = #{expr}; _m.nil? ? '' : \"$ \#{(_m / 100.0).round(2)}\")"
},
}