Sha256: 579d3abdcf9bfd3222dd49a998d327e491120c0baa99ee35587055e578648692
Contents?: true
Size: 690 Bytes
Versions: 10
Compression:
Stored size: 690 Bytes
Contents
module Middleman module Minified module Javascript include ::Haml::Filters::Base def render_with_options(text, options) if Middleman::Base.respond_to?(:minify_javascript?) && Middleman::Base.minify_javascript? compressor = ::YUI::JavaScriptCompressor.new(:munge => true) data = compressor.compress(text) %Q{<script type=#{options[:attr_wrapper]}text/javascript#{options[:attr_wrapper]}>#{data.chomp}</script>} else <<END <script type=#{options[:attr_wrapper]}text/javascript#{options[:attr_wrapper]}> //<![CDATA[ #{text.rstrip.gsub("\n", "\n ")} //]]> </script> END end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems