Sha256: ddcc1ea20df0b69d6c0739b9a14ea6d2d002df70f42403ae6bf3d52b9a7cbbce
Contents?: true
Size: 861 Bytes
Versions: 7
Compression:
Stored size: 861 Bytes
Contents
# frozen_string_literal: true # # This is here to allow you to block certain tags for certain templates. # Say in emails or exports it doesn't make sense to allow forms, you could exclude it as follows: # # template = Liquid::Template.parse(data, block_tags: %w[form]) # module Liquid class ParseContext def block_tags @options[:block_tags] end end class BlockBody alias parse_without_setting_parse_context parse def parse(tokenizer, parse_context, &block) @parse_context = parse_context parse_without_setting_parse_context(tokenizer, parse_context, &block) end def registered_tags allowed_tags = Template.tags.dup if @parse_context.block_tags.present? @parse_context.block_tags.each do |tag| allowed_tags.delete(tag) end end allowed_tags end end end
Version data entries
7 entries across 7 versions & 1 rubygems