Included Modules

Haml::Filters::Javascript

Surrounds the filtered text with `<script>` and CDATA tags. Useful for including inline Javascript.

Public Instance Methods

render_with_options(text, options) click to toggle source

@see Base#render_with_options

# File lib/haml/filters.rb, line 204
def render_with_options(text, options)
  if options[:format] == :html5
    type = ''
  else
    type = " type=#{options[:attr_wrapper]}text/javascript#{options[:attr_wrapper]}"
  end

  <script#{type}>  //<![CDATA[    #{text.rstrip.gsub("\n", "\n    ")}  //]]></script>
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.