File tree Expand file tree Collapse file tree 4 files changed +33
-1
lines changed Expand file tree Collapse file tree 4 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 22
33## 5.8.1 (unreleased)
44
5+ ## 5.8.1
6+
7+ * Fix ` {% doc %} ` tag to be visitable [ Guilherme Carreiro]
8+
59## 5.8.0
610
711* Introduce the new ` {% doc %} ` tag [ Guilherme Carreiro]
Original file line number Diff line number Diff line change @@ -55,6 +55,10 @@ def blank?
5555 true
5656 end
5757
58+ def nodelist
59+ [ ]
60+ end
61+
5862 private
5963
6064 def ensure_valid_markup ( tag_name , markup , parse_context )
Original file line number Diff line number Diff line change 22# frozen_string_literal: true
33
44module Liquid
5- VERSION = "5.8.0 "
5+ VERSION = "5.8.1 "
66end
Original file line number Diff line number Diff line change @@ -157,4 +157,28 @@ def test_doc_tag_delimiter_handling
157157 assert_template_result ( '' , "{% doc %}123{% enddoc\n xyz %}" )
158158 assert_template_result ( '' , "{% doc %}123{% enddoc\n xyz enddoc %}" )
159159 end
160+
161+ def test_doc_tag_visitor
162+ template_source = '{% doc %}{% enddoc %}'
163+
164+ assert_equal (
165+ [ Liquid ::Doc ] ,
166+ visit ( template_source ) ,
167+ )
168+ end
169+
170+ private
171+
172+ def traversal ( template )
173+ ParseTreeVisitor
174+ . for ( Template . parse ( template ) . root )
175+ . add_callback_for ( Liquid ::Doc ) do |tag |
176+ tag_class = tag . class
177+ tag_class
178+ end
179+ end
180+
181+ def visit ( template )
182+ traversal ( template ) . visit . flatten . compact
183+ end
160184end
You can’t perform that action at this time.
0 commit comments