Covered changes with more tests, remove redundant cases, and the new with_error_mode(*modes)

Most of changes update this:
```
[:lax, :strict].each do |mode|
  with_error_mode(mode) do
    assert_template_result(...
```

to be this:
```
with_error_mode(:lax, :strict) do
  assert_template_result(...
```
This commit is contained in:
Guilherme Carreiro
2025-10-27 16:33:31 +01:00
committed by Guilherme Carreiro
parent a23c71e40b
commit 018442b7d1
10 changed files with 229 additions and 357 deletions
-1
View File
@@ -123,7 +123,6 @@ module Liquid
block.attach(body)
@blocks << block
# Temporarily until support :or lexeme.
break unless parser.id?('or') || parser.consume?(:comma)
end
-1
View File
@@ -90,7 +90,6 @@ module Liquid
end
end
# Temporarily until we migrate
def strict_parse(markup)
lax_parse(markup)
end
+2 -2
View File
@@ -24,8 +24,8 @@ module Liquid
# Sets how strict the parser should be.
# :lax acts like liquid 2.5 and silently ignores malformed tags in most cases.
# :warn is the default and will give deprecation warnings when invalid syntax is used.
# :strict will enforce correct syntax.
# :rigid is stricter even.
# :strict enforces correct syntax for most tags
# :rigid enforces correct syntax for all tags
def error_mode=(mode)
Deprecations.warn("Template.error_mode=", "Environment#error_mode=")
Environment.default.error_mode = mode