FIX: remove links and html 'hellips' from topic/post summaries
This commit is contained in:
parent
a4ce039c85
commit
fe007d08b3
|
@ -10,8 +10,8 @@ class UserProfile < ActiveRecord::Base
|
||||||
|
|
||||||
BAKED_VERSION = 1
|
BAKED_VERSION = 1
|
||||||
|
|
||||||
def bio_excerpt(length=350)
|
def bio_excerpt(length=350, opts={})
|
||||||
excerpt = PrettyText.excerpt(bio_cooked, length)
|
excerpt = PrettyText.excerpt(bio_cooked, length, opts)
|
||||||
return excerpt if excerpt.blank? || (user.has_trust_level?(TrustLevel[1]) && !user.suspended?)
|
return excerpt if excerpt.blank? || (user.has_trust_level?(TrustLevel[1]) && !user.suspended?)
|
||||||
PrettyText.strip_links(excerpt)
|
PrettyText.strip_links(excerpt)
|
||||||
end
|
end
|
||||||
|
@ -23,7 +23,7 @@ class UserProfile < ActiveRecord::Base
|
||||||
|
|
||||||
def bio_summary
|
def bio_summary
|
||||||
return nil unless bio_cooked.present?
|
return nil unless bio_cooked.present?
|
||||||
bio_excerpt(500)
|
bio_excerpt(500, strip_links: true, text_entities: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def recook_bio
|
def recook_bio
|
||||||
|
|
|
@ -114,7 +114,8 @@ class TopicView
|
||||||
def summary
|
def summary
|
||||||
return nil if desired_post.blank?
|
return nil if desired_post.blank?
|
||||||
# TODO, this is actually quite slow, should be cached in the post table
|
# 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
|
end
|
||||||
|
|
||||||
def image_url
|
def image_url
|
||||||
|
|
Loading…
Reference in New Issue