mirror of
https://github.com/kemko/liquid.git
synced 2026-01-12 13:05:46 +03:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2f467bdbc | ||
|
|
ff99d92c18 | ||
|
|
39fecd06db |
@@ -1,5 +1,10 @@
|
||||
# Liquid Change Log
|
||||
|
||||
## 4.0.3 / 2019-03-12
|
||||
|
||||
### Fixed
|
||||
* Fix break and continue tags inside included templates in loops (#1072) [Justin Li]
|
||||
|
||||
## 4.0.2 / 2019-03-08
|
||||
|
||||
### Changed
|
||||
|
||||
@@ -89,6 +89,7 @@ module Liquid
|
||||
break
|
||||
else # Other non-Block tags
|
||||
render_node_to_output(node, output, context)
|
||||
break if context.interrupt? # might have happened through an include
|
||||
end
|
||||
idx += 1
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# encoding: utf-8
|
||||
|
||||
module Liquid
|
||||
VERSION = "4.0.2".freeze
|
||||
VERSION = "4.0.3".freeze
|
||||
end
|
||||
|
||||
@@ -30,6 +30,9 @@ class TestFileSystem
|
||||
when 'assignments'
|
||||
"{% assign foo = 'bar' %}"
|
||||
|
||||
when 'break'
|
||||
"{% break %}"
|
||||
|
||||
else
|
||||
template_path
|
||||
end
|
||||
@@ -242,4 +245,9 @@ class IncludeTagTest < Minitest::Test
|
||||
|
||||
assert_equal [], template.errors
|
||||
end
|
||||
|
||||
def test_break_through_include
|
||||
assert_template_result "1", "{% for i in (1..3) %}{{ i }}{% break %}{{ i }}{% endfor %}"
|
||||
assert_template_result "1", "{% for i in (1..3) %}{{ i }}{% include 'break' %}{{ i }}{% endfor %}"
|
||||
end
|
||||
end # IncludeTagTest
|
||||
|
||||
Reference in New Issue
Block a user