module Cleaners::ReplaceHTMLMarkup
Unescape HTML Markup ( case-insensitive )
Constants
- HTML_MARKUP
Public Class Methods
call(string)
click to toggle source
# File lib/data_cleansing/cleaners.rb, line 61 def self.call(string) return string unless string.is_a?(String) string.gsub!(HTML_MARKUP) do |match| case match.downcase when '&' then '&' when '"' then '"' when '>' then '>' when '<' then '<' when ''' then "'" when ' ' then ' ' else "&#{match};" end end || string end