FIX: remove links and html 'hellips' from topic/post summaries

This commit is contained in:
Régis Hanol
2014-12-08 00:23:53 +01:00
parent a4ce039c85
commit fe007d08b3
2 changed files with 5 additions and 4 deletions

View File

@@ -114,7 +114,8 @@ class TopicView
def summary
return nil if desired_post.blank?
# TODO, this is actually quite slow, should be cached in the post table
desired_post.excerpt(500)
excerpt = desired_post.excerpt(500, strip_links: true, text_entities: true)
(excerpt || "").gsub(/\n/, ' ').strip
end
def image_url