Module: Hamlit::Utils

Defined in:
lib/hamlit/utils.rb,
ext/hamlit/hamlit.c

Class Method Summary collapse

Class Method Details

.escape_html(html) ⇒ Object


86
87
88
# File 'ext/hamlit/hamlit.c', line 86

def self.escape_html(html)
  CGI.escapeHTML(html.to_s)
end

.escape_html_safe(html) ⇒ Object


16
17
18
# File 'lib/hamlit/utils.rb', line 16

def self.escape_html_safe(html)
  html.html_safe? ? html : escape_html(html)
end