mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 15:30:39 -07:00
Add url_encode standard filter
This commit is contained in:
@@ -42,6 +42,10 @@ module Liquid
|
||||
input.to_s.gsub(HTML_ESCAPE_ONCE_REGEXP, HTML_ESCAPE)
|
||||
end
|
||||
|
||||
def url_encode(input)
|
||||
CGI.escape(input) rescue input
|
||||
end
|
||||
|
||||
def slice(input, offset, length=nil)
|
||||
offset = Integer(offset)
|
||||
length = length ? Integer(length) : 1
|
||||
|
||||
Reference in New Issue
Block a user