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!("[/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[:topic_id] = source_topic_id if source_topic_id > 0
|
||||
|
|
|
@ -658,6 +658,18 @@ HTML
|
|||
expect(cooked.scan('quote]').length).to eq(0)
|
||||
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
|
||||
|
||||
topic = Fabricate(:topic, title: "this is a test topic :slight_smile:")
|
||||
|
|
Loading…
Reference in New Issue