Sha256: 095d4357be314a1cd2da3d7e2e80d454fd8e1973580c89dc98e061723490fd5b

Contents?: true

Size: 444 Bytes

Versions: 9

Compression:

Stored size: 444 Bytes

Contents

# frozen-string-literal: true
require_relative 'base'

module Faml
  module FilterCompilers
    class Javascript < Base
      def compile(ast)
        temple = [:multi, [:static, "\n"], [:newline]]
        compile_texts(temple, ast.lineno, ast.texts, tab_width: 2)
        temple << [:static, "\n"]
        [:haml, :tag, 'script', false, [:html, :attrs], [:html, :js, temple]]
      end
    end

    register(:javascript, Javascript)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
faml-0.7.3 lib/faml/filter_compilers/javascript.rb
faml-0.7.2 lib/faml/filter_compilers/javascript.rb
faml-0.7.1 lib/faml/filter_compilers/javascript.rb
faml-0.7.0 lib/faml/filter_compilers/javascript.rb
faml-0.6.5 lib/faml/filter_compilers/javascript.rb
faml-0.6.4 lib/faml/filter_compilers/javascript.rb
faml-0.6.3 lib/faml/filter_compilers/javascript.rb
faml-0.6.2 lib/faml/filter_compilers/javascript.rb
faml-0.6.1 lib/faml/filter_compilers/javascript.rb