Sha256: 7961159527d6aeeffd84efb08af12b4ff0be6dc20d3354b0e25411b2c8dea06b

Contents?: true

Size: 421 Bytes

Versions: 24

Compression:

Stored size: 421 Bytes

Contents

module Haml::Filters::Opal
  include Haml::Filters::Base

  def render_with_options ruby, options
    text = ::Opal.compile(ruby)

    if options[:format] == :html5
      type = ''
    else
      type = " type=#{options[:attr_wrapper]}text/javascript#{options[:attr_wrapper]}"
    end

    text.rstrip!
    text.gsub!("\n", "\n    ")

    <<HTML
<script#{type}>
  //<![CDATA[
    #{text}
  //]]>
</script>
HTML
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
opal-rails-2.0.2 lib/opal/rails/haml_filter.rb
opal-rails-2.0.1 lib/opal/rails/haml_filter.rb
opal-rails-2.0.0 lib/opal/rails/haml_filter.rb
opal-rails-1.1.2 lib/opal/rails/haml_filter.rb
opal-rails-1.1.1 lib/opal/rails/haml_filter.rb
opal-rails-1.1.0 lib/opal/rails/haml_filter.rb
opal-rails-1.0.1 lib/opal/rails/haml_filter.rb
opal-rails-1.0.0 lib/opal/rails/haml_filter.rb
opal-rails-1.0.0.rc1 lib/opal/rails/haml_filter.rb
opal-rails-0.9.5 lib/opal/rails/haml_filter.rb
opal-rails-0.9.4 lib/opal/rails/haml_filter.rb
opal-rails-0.9.3 lib/opal/rails/haml_filter.rb
opal-rails-0.9.1 lib/opal/rails/haml_filter.rb
opal-rails-0.9.0 lib/opal/rails/haml_filter.rb
opal-rails-0.8.1 lib/opal/rails/haml_filter.rb
opal-rails-0.8.0 lib/opal/rails/haml_filter.rb
opal-rails-0.8.0.rc1 lib/opal/rails/haml_filter.rb
opal-rails-0.7.0 lib/opal/rails/haml_filter.rb
opal-rails-0.7.0.beta2 lib/opal/rails/haml_filter.rb
opal-rails-0.7.0.beta1 lib/opal/rails/haml_filter.rb