mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 11:20:41 -07:00
clarify sort_natural and fix unless syntax
This commit is contained in:
@@ -358,7 +358,11 @@ module Liquid
|
|||||||
# @liquid_type filter
|
# @liquid_type filter
|
||||||
# @liquid_category array
|
# @liquid_category array
|
||||||
# @liquid_summary
|
# @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_syntax array | sort_natural
|
||||||
# @liquid_return [array[untyped]]
|
# @liquid_return [array[untyped]]
|
||||||
def sort_natural(input, property = nil)
|
def sort_natural(input, property = nil)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ module Liquid
|
|||||||
# @liquid_syntax
|
# @liquid_syntax
|
||||||
# {% unless condition %}
|
# {% unless condition %}
|
||||||
# expression
|
# expression
|
||||||
# {% endif %}
|
# {% endunless %}
|
||||||
# @liquid_syntax_keyword condition The condition to evaluate.
|
# @liquid_syntax_keyword condition The condition to evaluate.
|
||||||
# @liquid_syntax_keyword expression The expression to render unless the condition is met.
|
# @liquid_syntax_keyword expression The expression to render unless the condition is met.
|
||||||
class Unless < If
|
class Unless < If
|
||||||
|
|||||||
Reference in New Issue
Block a user