Sha256: 61cdc14c548bba71f9ccf5a1849c59caad0bf5985a34affcf2021a8e095177a2

Contents?: true

Size: 486 Bytes

Versions: 36

Compression:

Stored size: 486 Bytes

Contents

# frozen_string_literal: true
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

36 entries across 36 versions & 1 rubygems

Version Path
hamlit-2.12.0-java lib/hamlit/filters/escaped.rb
hamlit-2.12.0 lib/hamlit/filters/escaped.rb
hamlit-2.11.1 lib/hamlit/filters/escaped.rb
hamlit-2.11.0-java lib/hamlit/filters/escaped.rb
hamlit-2.11.0 lib/hamlit/filters/escaped.rb
hamlit-2.10.1-java lib/hamlit/filters/escaped.rb
hamlit-2.10.1 lib/hamlit/filters/escaped.rb
hamlit-2.10.0-java lib/hamlit/filters/escaped.rb
hamlit-2.10.0 lib/hamlit/filters/escaped.rb
hamlit-2.9.5-java lib/hamlit/filters/escaped.rb
hamlit-2.9.4-java lib/hamlit/filters/escaped.rb
hamlit-2.9.5 lib/hamlit/filters/escaped.rb
hamlit-2.9.4 lib/hamlit/filters/escaped.rb
hamlit-2.9.3-java lib/hamlit/filters/escaped.rb
hamlit-2.9.3 lib/hamlit/filters/escaped.rb
hamlit-2.9.2-java lib/hamlit/filters/escaped.rb
hamlit-2.9.2 lib/hamlit/filters/escaped.rb
hamlit-2.9.1-java lib/hamlit/filters/escaped.rb
hamlit-2.9.1 lib/hamlit/filters/escaped.rb
hamlit-2.9.0 lib/hamlit/filters/escaped.rb