use reduce to format strings
This commit is contained in:
parent
8cb5953ea4
commit
650fe5c1fd
|
@ -207,8 +207,8 @@ module Jekyll
|
|||
end
|
||||
|
||||
def format_string(string)
|
||||
FORMAT_STRING_METHODS.each do |method|
|
||||
string = filters.public_send(method, string)
|
||||
string = FORMAT_STRING_METHODS.reduce(string) do |memo, method|
|
||||
filters.public_send(method, memo)
|
||||
end
|
||||
|
||||
string unless string.empty?
|
||||
|
|
Loading…
Reference in New Issue