Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/qna_maker/string.rb

Overview

Monkey-patched String method for fixing responses.

Instance Method Summary collapse

Instance Method Details

#normalizeString

Fixes <, & and other &‘s characters, replaces crlf to lf newlines.

Returns:

  • (String)

    same text with correctly displayed &xxxx; characters and lf newlines.



14
15
16
# File 'lib/qna_maker/string.rb', line 14

def normalize
  CODER.decode(self).gsub(/\r\n?/, "\n")
end