Gon::Escaper

Public Class Methods

escape_unicode(javascript) click to toggle source
# File lib/gon/escaper.rb, line 8
def escape_unicode(javascript)
  if javascript
    result = escape_line_separator(javascript)
    javascript.html_safe? ? result.html_safe : result
  end
end
javascript_cdata_section(content, cdata) click to toggle source
# File lib/gon/escaper.rb, line 20
def javascript_cdata_section(content, cdata)
  if cdata
    "\n//#{cdata_section("\n#{content}\n//")}\n"
  else
    "\n#{content}\n"
  end
end
javascript_tag(content, type, cdata) click to toggle source
# File lib/gon/escaper.rb, line 15
def javascript_tag(content, type, cdata)
  type = { type: 'text/javascript' } if type
  content_tag(:script, javascript_cdata_section(content, cdata).html_safe, type)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.