Module: ScormEngine::Utils

Defined in:
lib/scorm_engine/utils.rb

Class Method Summary collapse

Class Method Details

.sanitized_text(text) ⇒ Object

TODO: Document this


8
9
10
11
# File 'lib/scorm_engine/utils.rb', line 8

def self.sanitized_text(text)
  text = text.to_s.encode("utf-8", invalid: :replace, undef: :replace)
  CGI.unescape_html(text).gsub(/<.*?>/, "").strip.gsub(/\s+/, " ")
end