lib/has_meta.rb in has_meta-0.0.3 vs lib/has_meta.rb in has_meta-0.0.4

- old
+ new

@@ -18,12 +18,13 @@ if fields.is_a? Proc str = fields.call(self) else field = [*fields].detect{|f| send(f).present?} return nil if field.nil? - str = send(field).to_s.strip + str = send(field) end + str = str.to_s.strip str.gsub!('&nbsp;', ' ') str.gsub!(/<.*?>/, '') str = ::CGI::unescapeHTML(str) str = (str[0,length - 3] + '...') if str.size > length str