Class: Liquid::Raw

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

Constant Summary collapse

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

Constants inherited from Block

Block::ContentOfVariable, Block::FullToken, Block::TAGSTART, Block::VARSTART

Instance Attribute Summary

Attributes inherited from Tag

#line_number, #nodelist, #options, #warnings

Instance Method Summary collapse

Methods inherited from Block

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

Methods inherited from Tag

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

Methods included from ParserSwitching

#parse_with_selected_parser

Constructor Details

This class inherits a constructor from Liquid::Tag

Instance Method Details

#parse(tokens) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# 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
      return if block_delimiter == $2
    end
    @nodelist << token if not token.empty?
  end
end