Permalink
Browse files

<script> wrapper

  • Loading branch information...
inem committed Jan 14, 2010
1 parent e7b0e10 commit 6080a5d5684109fc52c3430ca3867ba92433217b
Showing with 18 additions and 2 deletions.
  1. +18 −2 lib/haml/filters/coffee.rb
View
@@ -3,7 +3,23 @@ module Haml::Filters::Coffee
lazy_require 'coffee-script'
- def render(text)
- CoffeeScript.compile(text)
+ def render_with_options(text, options)
+ <<END
+<script type=#{options[:attr_wrapper]}text/javascript#{options[:attr_wrapper]}>
+ //<![CDATA[
+ #{CoffeeScript.compile(text)}
+ //]]>
+</script>
+END
end
+
+ # def render(text)
+ # <<END
+ # <script type=#{options[:attr_wrapper]}text/javascript#{options[:attr_wrapper]}>
+ # //<![CDATA[
+ # #{CoffeeScript.compile(text)}
+ # //]]>
+ # </script>
+ # END
+ # end
end

0 comments on commit 6080a5d

Please sign in to comment.