Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.3
-
None
Description
The example below works as expected when run in Groovy 2.5.8, yet it fails when run in Groovy 3.0.3
TemplateEngine engine = new StreamingTemplateEngine()
Template template = engine.createTemplate('''
<ul>
<% items.each { %>
<li>${it}</li>
<% } %>
</ul>
''')
println template.make([items : [1,2,3,4]])
Expected output (and the output 2.5.8 yields):
<ul> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul>
Exception 3.0.3 gives:
Exception in thread "main" groovy.text.TemplateParseException: Template parse error 'Unexpected input: '{'; Expecting RBRACE ' at line 3, column 27 2: <ul> --> 3: <% items.each { %> 4: <li>${it}</li>