mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 03:10:46 -06:00
UX: keep emojis in excerpts in flag queue
This commit is contained in:
parent
2f3f5477b0
commit
89e919ec42
@ -131,7 +131,7 @@ module FlagQuery
|
||||
private
|
||||
|
||||
def self.excerpt(cooked)
|
||||
excerpt = Post.excerpt(cooked, 200)
|
||||
excerpt = Post.excerpt(cooked, 200, keep_emoji_images: true)
|
||||
# remove the first link if it's the first node
|
||||
fragment = Nokogiri::HTML.fragment(excerpt)
|
||||
if fragment.children.first == fragment.css("a:first").first && fragment.children.first
|
||||
|
@ -29,12 +29,13 @@ describe FlagQuery do
|
||||
|
||||
PostAction.act(codinghorror, post, PostActionType.types[:spam])
|
||||
PostAction.act(user2, post, PostActionType.types[:spam])
|
||||
mod_message = PostAction.act(user3, post, PostActionType.types[:notify_moderators], message: "this is a 10")
|
||||
mod_message = PostAction.act(user3, post, PostActionType.types[:notify_moderators], message: "this is a :one::zero:")
|
||||
|
||||
PostAction.act(codinghorror, post2, PostActionType.types[:spam])
|
||||
PostAction.act(user2, post2, PostActionType.types[:spam])
|
||||
|
||||
posts, topics, users = FlagQuery.flagged_posts_report(admin, "")
|
||||
|
||||
expect(posts.count).to eq(2)
|
||||
first = posts.first
|
||||
|
||||
@ -47,6 +48,7 @@ describe FlagQuery do
|
||||
|
||||
expect(second[:post_actions].count).to eq(3)
|
||||
expect(second[:post_actions].first[:permalink]).to eq(mod_message.related_post.topic.relative_url)
|
||||
expect(second[:post_actions].first[:conversation][:response][:excerpt]).to match("<img src=")
|
||||
|
||||
posts, users = FlagQuery.flagged_posts_report(admin, "", 1)
|
||||
expect(posts.count).to eq(1)
|
||||
|
Loading…
Reference in New Issue
Block a user