Sha256: 01bd1dcaeb589a143ad3dd185be27c7dd0316614cf96dd7f5bc76cffffee5b21

Contents?: true

Size: 570 Bytes

Versions: 4

Compression:

Stored size: 570 Bytes

Contents

module Liquid
  class Raw < Block
    FullTokenPossiblyInvalid = /\A(.*)#{TagStart}\s*(\w+)\s*(.*)?#{TagEnd}\z/om

    def parse(tokens)
      @body = ''
      while token = tokens.shift
        if token =~ FullTokenPossiblyInvalid
          @body << $1 if $1 != "".freeze
          return if block_delimiter == $2
        end
        @body << token if not token.empty?
      end
    end

    def render(context)
      @body
    end

    def nodelist
      [@body]
    end

    def blank?
      @body.empty?
    end
  end

  Template.register_tag('raw'.freeze, Raw)
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
locomotivecms-liquid-4.0.0 lib/liquid/tags/raw.rb
locomotivecms-liquid-4.0.0.alpha2 lib/liquid/tags/raw.rb
locomotivecms-liquid-4.0.0.alpha1 lib/liquid/tags/raw.rb
locomotivecms-liquid-4.0.0.alpha lib/liquid/tags/raw.rb