mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
Fix bug where links to posts weren't being tracked
This commit is contained in:
@ -148,6 +148,14 @@ test
|
||||
PrettyText.extract_links("<a href='http://cnn.com'>http://bla.com</a>").to_a.should == ["http://cnn.com"]
|
||||
end
|
||||
|
||||
it "should extract links to topics" do
|
||||
PrettyText.extract_links("<aside class=\"quote\" data-topic=\"321\">aside</aside>").to_a.should == ["/t/topic/321"]
|
||||
end
|
||||
|
||||
it "should extract links to posts" do
|
||||
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 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