mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-18 02:10:41 -07:00
Revert "Use replacement string for replace filters literally (#924)"
This reverts commit 27c91203ab.
This commit is contained in:
@@ -201,14 +201,12 @@ module Liquid
|
||||
|
||||
# Replace occurrences of a string with another
|
||||
def replace(input, string, replacement = ''.freeze)
|
||||
replacement = replacement.to_s
|
||||
input.to_s.gsub(string.to_s) { replacement }
|
||||
input.to_s.gsub(string.to_s, replacement.to_s)
|
||||
end
|
||||
|
||||
# Replace the first occurrences of a string with another
|
||||
def replace_first(input, string, replacement = ''.freeze)
|
||||
replacement = replacement.to_s
|
||||
input.to_s.sub(string.to_s) { replacement }
|
||||
input.to_s.sub(string.to_s, replacement.to_s)
|
||||
end
|
||||
|
||||
# remove a substring
|
||||
|
||||
Reference in New Issue
Block a user