mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 00:55:11 -07:00
Fix implementation of escape and money filters
This commit is contained in:
@@ -202,10 +202,10 @@ module Liquid
|
|||||||
RUBY
|
RUBY
|
||||||
},
|
},
|
||||||
"escape" => ->(compiler, expr, args, kwargs) {
|
"escape" => ->(compiler, expr, args, kwargs) {
|
||||||
"(_t = #{expr}; CGI.escape(_t) unless _t)"
|
"(_t = #{expr}; CGI.escape(_t) if _t)"
|
||||||
},
|
},
|
||||||
"money" => ->(compiler, expr, args, kwargs) {
|
"money" => ->(compiler, expr, args, kwargs) {
|
||||||
"(_m = #{expr}; _m.nil? ? '' : \"\#{(_m / 100.0).round(2)}\")"
|
"(_m = #{expr}; _m.nil? ? '' : \"$ \#{(_m / 100.0).round(2)}\")"
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user