Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiment: Hardcode parser to :strict everywhere #1931

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions lib/liquid/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ module Liquid
# The Environment is the container for all configuration options of Liquid, such as
# the registered tags, filters, and the default error mode.
class Environment
# The default error mode for all templates. This can be overridden on a
# per-template basis.
attr_accessor :error_mode

# The tags that are available to use in the template.
attr_accessor :tags

Expand Down Expand Up @@ -75,7 +71,7 @@ def dangerously_override(environment)
# @api private
def initialize
@tags = Tags::STANDARD_TAGS.dup
@error_mode = :lax
@error_mode = :strict
@strainer_template = Class.new(StrainerTemplate).tap do |klass|
klass.add_filter(StandardFilters)
end
Expand All @@ -85,6 +81,14 @@ def initialize
@strainer_template_class_cache = {}
end

def error_mode
:strict
end

def error_mode=(mode)
:strict
end

# Registers a new tag with the environment.
#
# @param name [String] The name of the tag.
Expand Down
4 changes: 2 additions & 2 deletions lib/liquid/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class << self
# :strict will enforce correct syntax.
def error_mode=(mode)
Deprecations.warn("Template.error_mode=", "Environment#error_mode=")
Environment.default.error_mode = mode
Environment.default.error_mode = :strict
end

def error_mode
Environment.default.error_mode
:strict
end

def default_exception_renderer=(renderer)
Expand Down
Loading