mirror of
https://github.com/discourse/discourse.git
synced 2025-04-03 05:39:41 +08:00
FIX: stop using inline quote for local onebox
This commit is contained in:
parent
bca678ee5a
commit
5897ae945a
@ -56,7 +56,7 @@ module Onebox
|
|||||||
excerpt.gsub!(/[\r\n]+/, " ")
|
excerpt.gsub!(/[\r\n]+/, " ")
|
||||||
excerpt.gsub!("[/quote]", "[quote]") # don't break my quote
|
excerpt.gsub!("[/quote]", "[quote]") # don't break my quote
|
||||||
|
|
||||||
quote = "[quote=\"#{post.user.username}, topic:#{topic.id}, slug:#{slug}, post:#{post.post_number}\"]#{excerpt}[/quote]"
|
quote = "[quote=\"#{post.user.username}, topic:#{topic.id}, slug:#{slug}, post:#{post.post_number}\"]\n#{excerpt}\n[/quote]"
|
||||||
|
|
||||||
args = {}
|
args = {}
|
||||||
args[:topic_id] = source_topic_id if source_topic_id > 0
|
args[:topic_id] = source_topic_id if source_topic_id > 0
|
||||||
|
@ -658,6 +658,18 @@ HTML
|
|||||||
expect(cooked.scan('quote]').length).to eq(0)
|
expect(cooked.scan('quote]').length).to eq(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "can onebox local topics" do
|
||||||
|
op = Fabricate(:post)
|
||||||
|
reply = Fabricate(:post, topic_id: op.topic_id)
|
||||||
|
|
||||||
|
|
||||||
|
url = Discourse.base_url + reply.url
|
||||||
|
quote = create_post(topic_id: op.topic.id, raw: "This is a sample reply with a quote\n\n#{url}")
|
||||||
|
quote.reload
|
||||||
|
|
||||||
|
expect(quote.cooked).not_to include('[quote')
|
||||||
|
end
|
||||||
|
|
||||||
it "do off topic quoting with emoji unescape" do
|
it "do off topic quoting with emoji unescape" do
|
||||||
|
|
||||||
topic = Fabricate(:topic, title: "this is a test topic :slight_smile:")
|
topic = Fabricate(:topic, title: "this is a test topic :slight_smile:")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user