mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-29 15:15:19 -07:00
Add split filter.
This commit is contained in:
@@ -53,6 +53,11 @@ module Liquid
|
|||||||
wordlist.length > l ? wordlist[0..l].join(" ") + truncate_string : input
|
wordlist.length > l ? wordlist[0..l].join(" ") + truncate_string : input
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Split input string into an array of substrings separated by given pattern.
|
||||||
|
def split(input, pattern)
|
||||||
|
input.split(pattern)
|
||||||
|
end
|
||||||
|
|
||||||
def strip_html(input)
|
def strip_html(input)
|
||||||
input.to_s.gsub(/<script.*?<\/script>/, '').gsub(/<.*?>/, '')
|
input.to_s.gsub(/<script.*?<\/script>/, '').gsub(/<.*?>/, '')
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user