Compare commits

..

3 Commits

Author SHA1 Message Date
Justin Li
f2f467bdbc v4.0.3 2019-03-12 12:43:48 -04:00
Justin Li
ff99d92c18 Merge pull request #1072 from Shopify/fix-interrupts
Fix interrupts through includes
2019-03-12 12:26:12 -04:00
Justin Li
39fecd06db Fix interrupts through includes 2019-03-12 12:18:22 -04:00
4 changed files with 15 additions and 1 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -1,5 +1,5 @@
# encoding: utf-8
module Liquid
VERSION = "4.0.2".freeze
VERSION = "4.0.3".freeze
end

View File

@@ -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