Class: Liquid::Raw

Inherits:
Block show all
Defined in:
lib/liquid/tags/raw.rb

Constant Summary

FullTokenPossiblyInvalid =
/\A(.*)#{TagStart}\s*(\w+)\s*(.*)?#{TagEnd}\z/om

Constants inherited from Block

Block::ContentOfVariable, Block::FullToken, Block::IsTag, Block::IsVariable

Instance Attribute Summary

Attributes inherited from Tag

#nodelist, #options, #warnings

Instance Method Summary (collapse)

Methods inherited from Block

#blank?, #block_delimiter, #block_name, #create_variable, #end_tag, #render, #unknown_tag, #warnings

Methods inherited from Tag

#blank?, #initialize, #name, parse, #parse_with_selected_parser, #render

Constructor Details

This class inherits a constructor from Liquid::Tag

Instance Method Details

- (Object) parse(tokens)



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/liquid/tags/raw.rb', line 5

def parse(tokens)
  @nodelist ||= []
  @nodelist.clear
  while token = tokens.shift
    if token =~ FullTokenPossiblyInvalid
      @nodelist << $1 if $1 != "".freeze
      if block_delimiter == $2
        end_tag
        return
      end
    end
    @nodelist << token if not token.empty?
  end
end