Sha256: 55b89a092095d8af4b473318af76ba1ca6117b2f43762ca9986e237c1698fcda

Contents?: true

Size: 544 Bytes

Versions: 17

Compression:

Stored size: 544 Bytes

Contents

# frozen_string_literal: true
require 'haml/escape'

module Haml
  # This module allows Temple::Filter to dispatch :fescape on `#compile`.
  module EscapeanyDispathcer
    def on_escapeany(flag, exp)
      [:escapeany, flag, compile(exp)]
    end
  end
  ::Temple::Filter.include EscapeanyDispathcer

  # Unlike Haml::Escape, this calls to_s when not escaped.
  class EscapeAny < Escape
    alias_method :on_escapeany, :on_escape

    def on_dynamic(value)
      [:dynamic, @escape ? @escape_code % value : "(#{value}).to_s"]
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
haml-6.3.0 lib/haml/escape_any.rb
haml-6.2.5 lib/haml/escape_any.rb
haml-6.2.4 lib/haml/escape_any.rb
haml-6.2.3 lib/haml/escape_any.rb
haml-6.2.2 lib/haml/escape_any.rb
haml-6.2.1 lib/haml/escape_any.rb
haml-6.2.0 lib/haml/escape_any.rb
haml-6.1.4-java lib/haml/escape_any.rb
haml-6.1.4 lib/haml/escape_any.rb
haml-6.1.3-java lib/haml/escape_any.rb
haml-6.1.3 lib/haml/escape_any.rb
haml-6.1.2-java lib/haml/escape_any.rb
haml-6.1.2 lib/haml/escape_any.rb
haml-6.1.1-java lib/haml/escape_any.rb
haml-6.1.1 lib/haml/escape_any.rb
haml-6.1.0-java lib/haml/escape_any.rb
haml-6.1.0 lib/haml/escape_any.rb