mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: use URI.regexp to find URLs in plain text
This commit is contained in:
@@ -177,6 +177,14 @@ describe PlainTextToMarkdown do
|
||||
expect(to_markdown("foo https://www.example.com/foo.html bar https://www.example.com/foo.html baz"))
|
||||
.to eq("foo https://www.example.com/foo.html bar https://www.example.com/foo.html baz")
|
||||
end
|
||||
|
||||
it "does not explode with weird links" do
|
||||
expect {
|
||||
Timeout::timeout(0.25) {
|
||||
to_markdown("https://www.discourse.org/?boom=#{"." * 20}")
|
||||
}
|
||||
}.not_to raise_error
|
||||
end
|
||||
end
|
||||
|
||||
context "code" do
|
||||
|
||||
Reference in New Issue
Block a user