mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
FIX: Have onebox ignore internal links
This commit is contained in:
@ -162,6 +162,17 @@ test
|
||||
PrettyText.extract_links("<aside class=\"quote\" data-topic=\"1234\" data-post=\"4567\">aside</aside>").to_a.should == ["/t/topic/1234/4567"]
|
||||
end
|
||||
|
||||
it "should not extract links inside quotes" do
|
||||
PrettyText.extract_links("
|
||||
<a href='http://body_only.com'>http://useless1.com</a>
|
||||
<aside class=\"quote\" data-topic=\"1234\">
|
||||
<a href='http://body_and_quote.com'>http://useless3.com</a>
|
||||
<a href='http://quote_only.com'>http://useless4.com</a>
|
||||
</aside>
|
||||
<a href='http://body_and_quote.com'>http://useless2.com</a>
|
||||
").to_a.should == ["http://body_only.com", "http://body_and_quote.com", "/t/topic/1234"]
|
||||
end
|
||||
|
||||
it "should not preserve tags in code blocks" do
|
||||
PrettyText.excerpt("<pre><code class='handlebars'><h3>Hours</h3></code></pre>",100).should == "<h3>Hours</h3>"
|
||||
end
|
||||
|
Reference in New Issue
Block a user