Sha256: d9a9ecb0ab1d826299f4653b5d967dccb626777fbd3ec5de723e3bd0a37c89b5

Contents?: true

Size: 456 Bytes

Versions: 18

Compression:

Stored size: 456 Bytes

Contents

module Hamlit
  class Filters
    class Escaped < Base
      def compile(node)
        text = node.value[:text].rstrip
        temple = compile_text(text)
        [:escape, true, temple]
      end

      private

      def compile_text(text)
        if ::Hamlit::HamlUtil.contains_interpolation?(text)
          [:dynamic, ::Hamlit::HamlUtil.slow_unescape_interpolation(text)]
        else
          [:static, text]
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
hamlit-2.2.4 lib/hamlit/filters/escaped.rb
hamlit-2.6.1 lib/hamlit/filters/escaped.rb
hamlit-2.6.0 lib/hamlit/filters/escaped.rb
hamlit-2.5.0 lib/hamlit/filters/escaped.rb
hamlit-2.4.2 lib/hamlit/filters/escaped.rb
hamlit-2.4.1 lib/hamlit/filters/escaped.rb
hamlit-2.4.0 lib/hamlit/filters/escaped.rb
hamlit-2.3.1 lib/hamlit/filters/escaped.rb
hamlit-2.3.0 lib/hamlit/filters/escaped.rb
hamlit-2.2.3 lib/hamlit/filters/escaped.rb
hamlit-2.2.2 lib/hamlit/filters/escaped.rb
hamlit-2.2.1 lib/hamlit/filters/escaped.rb
hamlit-2.2.0 lib/hamlit/filters/escaped.rb
hamlit-2.1.2 lib/hamlit/filters/escaped.rb
hamlit-2.1.1 lib/hamlit/filters/escaped.rb
hamlit-2.1.0 lib/hamlit/filters/escaped.rb
hamlit-2.0.2 lib/hamlit/filters/escaped.rb
hamlit-2.0.1 lib/hamlit/filters/escaped.rb