Sha256: 640d44908f6502acb33103fe0d99f5f6cea9b5ff3b68d627871ee29c396fb94f

Contents?: true

Size: 1.07 KB

Versions: 94

Compression:

Stored size: 1.07 KB

Contents

module Slim
  # Base class for Temple filters used in Slim
  #
  # This base filter passes everything through and allows
  # to override only some methods without affecting the rest
  # of the expression.
  #
  # @api private
  class Filter < Temple::HTML::Filter
    # Pass-through handler
    def on_slim_embedded(type, content)
      [:slim, :embedded, code, compile(content)]
    end

    # Pass-through handler
    def on_slim_control(code, content)
      [:slim, :control, code, compile(content)]
    end

    # Pass-through handler
    def on_slim_condcomment(condition, content)
      [:slim, :condcomment, condition, compile(content)]
    end

    # Pass-through handler
    def on_slim_output(code, escape, content)
      [:slim, :output, code, escape, compile(content)]
    end

    # Pass-through handler
    def on_slim_attrs(*attrs)
      [:slim, :attrs, *attrs.map {|a| compile(a) }]
    end

    # Pass-through handler
    def on_slim_tag(name, attrs, content = nil)
      tag = [:slim, :tag, name, compile(attrs)]
      content ? (tag << compile(content)) : tag
    end
  end
end

Version data entries

94 entries across 49 versions & 2 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/slim-1.2.0/lib/slim/filter.rb
classiccms-0.7.5 vendor/bundle/gems/slim-1.2.1/lib/slim/filter.rb
classiccms-0.7.4 vendor/bundle/gems/slim-1.2.1/lib/slim/filter.rb
classiccms-0.7.4 vendor/bundle/gems/slim-1.2.0/lib/slim/filter.rb
classiccms-0.7.3 vendor/bundle/gems/slim-1.2.1/lib/slim/filter.rb
classiccms-0.7.3 vendor/bundle/gems/slim-1.2.0/lib/slim/filter.rb
classiccms-0.7.2 vendor/bundle/gems/slim-1.2.1/lib/slim/filter.rb
classiccms-0.7.2 vendor/bundle/gems/slim-1.2.0/lib/slim/filter.rb
classiccms-0.7.1 vendor/bundle/gems/slim-1.2.0/lib/slim/filter.rb
classiccms-0.7.1 vendor/bundle/gems/slim-1.2.1/lib/slim/filter.rb
classiccms-0.7.0 vendor/bundle/gems/slim-1.2.0/lib/slim/filter.rb
classiccms-0.7.0 vendor/bundle/gems/slim-1.2.1/lib/slim/filter.rb
classiccms-0.6.9 vendor/bundle/gems/slim-1.2.0/lib/slim/filter.rb
classiccms-0.6.9 vendor/bundle/gems/slim-1.2.1/lib/slim/filter.rb
classiccms-0.6.8 vendor/bundle/gems/slim-1.2.1/lib/slim/filter.rb
classiccms-0.6.8 vendor/bundle/gems/slim-1.2.0/lib/slim/filter.rb
classiccms-0.6.7 vendor/bundle/gems/slim-1.2.0/lib/slim/filter.rb
classiccms-0.6.7 vendor/bundle/gems/slim-1.2.1/lib/slim/filter.rb
classiccms-0.6.6 vendor/bundle/gems/slim-1.2.0/lib/slim/filter.rb
classiccms-0.6.6 vendor/bundle/gems/slim-1.2.1/lib/slim/filter.rb