mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-24 13:49:54 -04:00
FIX: clean html before sending it to jquery for collapsing
This commit is contained in:
parent
8be746b285
commit
8013b6a511
3 changed files with 8 additions and 12 deletions
|
@ -47,7 +47,7 @@
|
||||||
<b>{{i18n 'user.suspended_reason'}}</b> {{user.suspend_reason}}
|
<b>{{i18n 'user.suspended_reason'}}</b> {{user.suspend_reason}}
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if user.bio_cooked}}<div class='bio'>{{text-overflow class="overflow" text=user.bio_cooked}}</div>{{/if}}
|
{{#if user.bio_cooked}}<div class='bio'>{{text-overflow class="overflow" text=user.bio_excerpt}}</div>{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if user.card_badge}}
|
{{#if user.card_badge}}
|
||||||
|
|
|
@ -196,16 +196,7 @@ class UserSerializer < BasicUserSerializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def bio_excerpt
|
def bio_excerpt
|
||||||
# If they have a bio return it
|
object.user_profile.bio_excerpt(350 ,keep_newlines: true)
|
||||||
excerpt = object.user_profile.bio_excerpt
|
|
||||||
return excerpt if excerpt.present?
|
|
||||||
|
|
||||||
# Without a bio, determine what message to show
|
|
||||||
if scope.user && scope.user.id == object.id
|
|
||||||
I18n.t('user_profile.no_info_me', username_lower: object.username_lower)
|
|
||||||
else
|
|
||||||
I18n.t('user_profile.no_info_other', name: object.name)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def include_suspend_reason?
|
def include_suspend_reason?
|
||||||
|
|
|
@ -12,6 +12,7 @@ class ExcerptParser < Nokogiri::XML::SAX::Document
|
||||||
@strip_links = options[:strip_links] == true
|
@strip_links = options[:strip_links] == true
|
||||||
@text_entities = options[:text_entities] == true
|
@text_entities = options[:text_entities] == true
|
||||||
@markdown_images = options[:markdown_images] == true
|
@markdown_images = options[:markdown_images] == true
|
||||||
|
@keep_newlines = options[:keep_newlines] == true
|
||||||
@start_excerpt = false
|
@start_excerpt = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -92,7 +93,11 @@ class ExcerptParser < Nokogiri::XML::SAX::Document
|
||||||
@in_a = false
|
@in_a = false
|
||||||
end
|
end
|
||||||
when "p", "br"
|
when "p", "br"
|
||||||
characters(" ")
|
if @keep_newlines
|
||||||
|
characters("<br>", false, false, false)
|
||||||
|
else
|
||||||
|
characters(" ")
|
||||||
|
end
|
||||||
when "aside"
|
when "aside"
|
||||||
@in_quote = false
|
@in_quote = false
|
||||||
when "div", "span"
|
when "div", "span"
|
||||||
|
|
Loading…
Add table
Reference in a new issue