From 5660ce6945c5feb1591000d1ca8a0fee35d8ea3f Mon Sep 17 00:00:00 2001 From: "Charles-P. Clermont" Date: Tue, 14 Oct 2025 14:57:07 -0400 Subject: [PATCH] render end of string is not optional --- lib/liquid/tags/include.rb | 2 ++ lib/liquid/tags/render.rb | 2 ++ test/integration/tags/include_tag_test.rb | 4 ++++ test/integration/tags/render_tag_test.rb | 4 ++++ 4 files changed, 12 insertions(+) diff --git a/lib/liquid/tags/include.rb b/lib/liquid/tags/include.rb index b72a235b..e9049e65 100644 --- a/lib/liquid/tags/include.rb +++ b/lib/liquid/tags/include.rb @@ -111,6 +111,8 @@ module Liquid @attributes[key] = safe_parse_expression(p) p.consume?(:comma) # optional comma end + + p.consume(:end_of_string) end def strict_parse(markup) diff --git a/lib/liquid/tags/render.rb b/lib/liquid/tags/render.rb index 4f716b24..4df5b954 100644 --- a/lib/liquid/tags/render.rb +++ b/lib/liquid/tags/render.rb @@ -113,6 +113,8 @@ module Liquid @attributes[key] = safe_parse_expression(p) p.consume?(:comma) # optional comma end + + p.consume(:end_of_string) end def rigid_template_name(p) diff --git a/test/integration/tags/include_tag_test.rb b/test/integration/tags/include_tag_test.rb index e8cd6857..9f92f1b2 100644 --- a/test/integration/tags/include_tag_test.rb +++ b/test/integration/tags/include_tag_test.rb @@ -220,6 +220,10 @@ class IncludeTagTest < Minitest::Test '{% include "snippet" !!! arg1: "value1" ~~~ arg2: "value2" %}', error_mode: mode, ) + assert_syntax_error( + '{% include "snippet" | filter %}', + error_mode: mode, + ) end end diff --git a/test/integration/tags/render_tag_test.rb b/test/integration/tags/render_tag_test.rb index b6cd5cfb..15a0adc2 100644 --- a/test/integration/tags/render_tag_test.rb +++ b/test/integration/tags/render_tag_test.rb @@ -121,6 +121,10 @@ class RenderTagTest < Minitest::Test '{% render "snippet" !!! arg1: "value1" ~~~ arg2: "value2" %}', error_mode: mode, ) + assert_syntax_error( + '{% render "snippet" | filter %}', + error_mode: mode, + ) end end