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

Fix missing inheritance of disabled tags #1646

Merged
merged 1 commit into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/liquid/tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ def parse(tag_name, markup, tokenizer, parse_context)
end

def disable_tags(*tag_names)
@disabled_tags ||= []
@disabled_tags.concat(tag_names)
tag_names += disabled_tags
define_singleton_method(:disabled_tags) { tag_names }
prepend(Disabler)
end

private :new

protected

def disabled_tags
[]
end
end

def initialize(tag_name, markup, parse_context)
Expand Down
8 changes: 0 additions & 8 deletions lib/liquid/tag/disabler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
module Liquid
class Tag
module Disabler
module ClassMethods
attr_reader :disabled_tags
end

def self.prepended(base)
base.extend(ClassMethods)
end

def render_to_output_buffer(context, output)
context.with_disabled_tags(self.class.disabled_tags) do
super
Expand Down