Merge pull request #1595 from Shopify/jake-clarify-sort-natural

Clarify sort_natural and fix unless syntax
This commit is contained in:
NadaMarawan
2022-07-13 15:17:15 -04:00
committed by GitHub
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -358,7 +358,11 @@ module Liquid
# @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)
+1 -1
View File
@@ -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