lib/has_meta.rb in has_meta-0.0.4 vs lib/has_meta.rb in has_meta-0.0.5
- old
+ new
@@ -24,9 +24,17 @@
end
str = str.to_s.strip
str.gsub!(' ', ' ')
str.gsub!(/<.*?>/, '')
+
+ if meth.to_s == 'keywords'
+ str = str.gsub(/[\s,]+/, ',').
+ gsub(/\s+/, ' ').
+ gsub(/^,|,$/, '').
+ strip
+ end
+
str = ::CGI::unescapeHTML(str)
str = (str[0,length - 3] + '...') if str.size > length
str
}
end