Skip to content

Commit

Permalink
Merge pull request #1595 from Shopify/jake-clarify-sort-natural
Browse files Browse the repository at this point in the history
Clarify sort_natural and fix unless syntax
  • Loading branch information
NadaMarawan authored Jul 13, 2022
2 parents 8660501 + 74245cd commit 1fdc577
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/liquid/standardfilters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,11 @@ def sort(input, property = nil)
# @liquid_type filter
# @liquid_category array
# @liquid_summary
# Sorts the items in an array in case-insensitive alphabetical, or numerical, order.
# Sorts the items in an array in case-insensitive alphabetical order.
# @liquid_description
# > Caution:
# > You shouldn't use the `sort_natural` filter to sort numerical values. When comparing items an array, each item is converted to a
# > string, so sorting on numerical values can lead to unexpected results.
# @liquid_syntax array | sort_natural
# @liquid_return [array[untyped]]
def sort_natural(input, property = nil)
Expand Down
2 changes: 1 addition & 1 deletion lib/liquid/tags/unless.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module Liquid
# @liquid_syntax
# {% unless condition %}
# expression
# {% endif %}
# {% endunless %}
# @liquid_syntax_keyword condition The condition to evaluate.
# @liquid_syntax_keyword expression The expression to render unless the condition is met.
class Unless < If
Expand Down

0 comments on commit 1fdc577

Please sign in to comment.