Test number_like regex on stringified property (#7788)
Merge pull request 7788
This commit is contained in:
parent
8b44ee73ff
commit
b02ba76c8a
|
@ -372,7 +372,7 @@ module Jekyll
|
|||
# return numeric values as numbers for proper sorting
|
||||
def parse_sort_input(property)
|
||||
number_like = %r!\A\s*-?(?:\d+\.?\d*|\.\d+)\s*\Z!
|
||||
return property.to_f if property =~ number_like
|
||||
return property.to_f if property.to_s =~ number_like
|
||||
|
||||
property
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue