Sha256: 2d4c5ed7210891655658a972cc9424bcef5b230458249553c2b880143edac9f8

Contents?: true

Size: 552 Bytes

Versions: 1

Compression:

Stored size: 552 Bytes

Contents

require 'fast_haml/filter_compilers/base'

module FastHaml
  module FilterCompilers
    class Escaped < Base
      include Temple::Utils

      def compile(texts)
        temple = [:multi, [:newline]]
        compile_texts(temple, texts)
        temple << [:static, "\n"]
        escape_code = Temple::Filters::Escapable.new.instance_variable_get(:@escape_code)
        sym = unique_name
        [:multi,
          [:capture, sym, temple],
          [:dynamic, escape_code % sym],
        ]
      end
    end

    register(:escaped, Escaped)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fast_haml-0.1.10 lib/fast_haml/filter_compilers/escaped.rb