Skip to content

Commit

Permalink
fixup! Handle truncatewords word length out of range as if no truncat…
Browse files Browse the repository at this point in the history
…ion is needed
  • Loading branch information
dylanahsmith committed Oct 11, 2022
1 parent 05d1178 commit 047c920
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/liquid/standardfilters.rb
Expand Up @@ -255,7 +255,7 @@ def truncatewords(input, words = 15, truncate_string = "...")
wordlist = begin
input.split(" ", words + 1)
rescue RangeError
# integer too big for Strin#split, but we can semantically assume no truncation is needed
# integer too big for String#split, but we can semantically assume no truncation is needed
return input if words + 1 > MAX_I32
raise # unexpected error
end
Expand Down

0 comments on commit 047c920

Please sign in to comment.