Added append/prepend filters

This commit is contained in:
Tobias Lütke
2009-01-15 16:59:18 -05:00
parent 88309cf415
commit 13ddc6d96b
2 changed files with 23 additions and 1 deletions
+11 -1
View File
@@ -103,7 +103,17 @@ module Liquid
# remove the first occurrences of a substring
def remove_first(input, string)
input.to_s.sub(string, '')
end
end
# add one string to another
def append(input, string)
input.to_s + string.to_s
end
# prepend a string to another
def prepend(input, string)
string.to_s + input.to_s
end
# Add <br /> tags in front of all newlines in input string
def newline_to_br(input)