Sha256: bf6225b9cff218e892db84d266bba7969486749c5f31754018df30edef0c3c93
Contents?: true
Size: 1022 Bytes
Versions: 13
Compression:
Stored size: 1022 Bytes
Contents
module Locomotive module Steam module Liquid module Tags class Hybrid < ::Liquid::Block def render_as_block? @render_as_block end def parse(tokens) if @render_as_block = find_block_delimiter?(tokens) super else @body = nil @blank = false end end def find_block_delimiter?(tokenizer) tokenizer.instance_variable_get(:@tokens).each do |token| next if token.empty? if token.start_with?(::Liquid::BlockBody::TAGSTART) if token =~ ::Liquid::BlockBody::FullToken return false if Regexp.last_match(1) == @tag_name return true if Regexp.last_match(1) == block_delimiter end end end false end def nodelist @body&.nodelist || [] end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems