def cleanup_string(string, strip: true)
      return '' if string.nil?
      raise ArgumentError, 'Expected a string or an object that implements #to_str' unless string.respond_to?(:to_str)

      strip_tags(string.to_str).tap do |s|
        s.gsub!(/\s+/, ' ')
        s.strip! if strip
      end
    end
def cleanup_string(string, strip: true)
      return '' if string.nil?
      raise ArgumentError, 'Expected a string or an object that implements #to_str' unless string.respond_to?(:to_str)

      strip_tags(string.to_str).tap do |s|
        s.gsub!(/\s+/, ' ')
        s.strip! if strip
      end
    end
Removes HTML tags and squashes down all the spaces.

 @param [String] string input string.
 @return [String] input string with no HTML tags and consequent white
 space characters squashed into a single space.