mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
Merge branch 'Shopify:master' into master
This commit is contained in:
+4
-1
@@ -1,13 +1,16 @@
|
|||||||
# Liquid Change Log
|
# Liquid Change Log
|
||||||
|
|
||||||
## 5.0.2 (unreleased)
|
## 5.1.0 / 2021-09-09
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
* Add `remove_last`, and `replace_last` filters (#1422) [Anders Hagbard]
|
* Add `remove_last`, and `replace_last` filters (#1422) [Anders Hagbard]
|
||||||
* Add `base64_encode`, `base64_decode`, `base64_url_safe_encode`, and `base64_url_safe_decode` filters (#1450) [Daniel Insley]
|
* Add `base64_encode`, `base64_decode`, `base64_url_safe_encode`, and `base64_url_safe_decode` filters (#1450) [Daniel Insley]
|
||||||
|
* Introduce `to_liquid_value` in `Liquid::Drop` (#1441) [Michael Go]
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
* Fix support for using a String subclass for the liquid source (#1421) [Dylan Thacker-Smith]
|
* Fix support for using a String subclass for the liquid source (#1421) [Dylan Thacker-Smith]
|
||||||
|
* Add `ParseTreeVisitor` to `RangeLookup` (#1470) [CP Clermont]
|
||||||
|
* Translate `RangeError` to `Liquid::Error` for `truncatewords` with large int (#1431) [Dylan Thacker-Smith]
|
||||||
|
|
||||||
## 5.0.1 / 2021-03-24
|
## 5.0.1 / 2021-03-24
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ module Liquid
|
|||||||
# context['var'] = 'hi'
|
# context['var'] = 'hi'
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# context['var] #=> nil
|
# context['var'] #=> nil
|
||||||
def stack(new_scope = {})
|
def stack(new_scope = {})
|
||||||
push(new_scope)
|
push(new_scope)
|
||||||
yield
|
yield
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ module Liquid
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
attr_reader :start_obj, :end_obj
|
||||||
|
|
||||||
def initialize(start_obj, end_obj)
|
def initialize(start_obj, end_obj)
|
||||||
@start_obj = start_obj
|
@start_obj = start_obj
|
||||||
@end_obj = end_obj
|
@end_obj = end_obj
|
||||||
@@ -35,5 +37,11 @@ module Liquid
|
|||||||
Utils.to_integer(input)
|
Utils.to_integer(input)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class ParseTreeVisitor < Liquid::ParseTreeVisitor
|
||||||
|
def children
|
||||||
|
[@node.start_obj, @node.end_obj]
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Liquid
|
module Liquid
|
||||||
VERSION = "5.0.2.alpha"
|
VERSION = "5.1.0"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -790,6 +790,18 @@ class StandardFiltersTest < Minitest::Test
|
|||||||
assert_equal(expectation, @filters.where(input, "ok"))
|
assert_equal(expectation, @filters.where(input, "ok"))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_where_string_keys
|
||||||
|
input = [
|
||||||
|
"alpha", "beta", "gamma", "delta"
|
||||||
|
]
|
||||||
|
|
||||||
|
expectation = [
|
||||||
|
"beta",
|
||||||
|
]
|
||||||
|
|
||||||
|
assert_equal(expectation, @filters.where(input, "be"))
|
||||||
|
end
|
||||||
|
|
||||||
def test_where_no_key_set
|
def test_where_no_key_set
|
||||||
input = [
|
input = [
|
||||||
{ "handle" => "alpha", "ok" => true },
|
{ "handle" => "alpha", "ok" => true },
|
||||||
|
|||||||
@@ -159,6 +159,13 @@ class ParseTreeVisitorTest < Minitest::Test
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_for_range
|
||||||
|
assert_equal(
|
||||||
|
["test"],
|
||||||
|
visit(%({% for x in (1..test) %}{% endfor %}))
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
def test_tablerow_in
|
def test_tablerow_in
|
||||||
assert_equal(
|
assert_equal(
|
||||||
["test"],
|
["test"],
|
||||||
|
|||||||
Reference in New Issue
Block a user