mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 03:32:17 +08:00
FEATURE: Implement Onebox for posts including polls. (#7539)
This commit is contained in:

committed by
Régis Hanol

parent
c77bc525cb
commit
227c45107d
@ -24,6 +24,7 @@ class UserProfile < ActiveRecord::Base
|
||||
BAKED_VERSION = 1
|
||||
|
||||
def bio_excerpt(length = 350, opts = {})
|
||||
return nil if bio_cooked.blank?
|
||||
excerpt = PrettyText.excerpt(bio_cooked, length, opts).sub(/<br>$/, '')
|
||||
return excerpt if excerpt.blank? || (user.has_trust_level?(TrustLevel[1]) && !user.suspended?)
|
||||
PrettyText.strip_links(excerpt)
|
||||
@ -35,7 +36,6 @@ class UserProfile < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def bio_summary
|
||||
return nil unless bio_cooked.present?
|
||||
bio_excerpt(500, strip_links: true, text_entities: true)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user