mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: Email cooker should link links that don't begin a line
This commit is contained in:
parent
57f1bf1ddd
commit
6db50b820d
2 changed files with 5 additions and 1 deletions
|
@ -3,7 +3,7 @@
|
||||||
class EmailCook
|
class EmailCook
|
||||||
|
|
||||||
def self.url_regexp
|
def self.url_regexp
|
||||||
/^((?:https?:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.])(?:[^\s()<>]+|\([^\s()<>]+\))+(?:\([^\s()<>]+\)|[^`!()\[\]{};:'".,<>?«»“”‘’\s]))/
|
/((?:https?:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.])(?:[^\s()<>]+|\([^\s()<>]+\))+(?:\([^\s()<>]+\)|[^`!()\[\]{};:'".,<>?«»“”‘’\s]))/
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(raw)
|
def initialize(raw)
|
||||||
|
|
|
@ -30,4 +30,8 @@ LONG_COOKED
|
||||||
it 'autolinks' do
|
it 'autolinks' do
|
||||||
expect(EmailCook.new("https://www.eviltrout.com").cook).to eq("<a href='https://www.eviltrout.com'>https://www.eviltrout.com</a><br>")
|
expect(EmailCook.new("https://www.eviltrout.com").cook).to eq("<a href='https://www.eviltrout.com'>https://www.eviltrout.com</a><br>")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'autolinks without the beginning of a line' do
|
||||||
|
expect(EmailCook.new("my site: https://www.eviltrout.com").cook).to eq("my site: <a href='https://www.eviltrout.com'>https://www.eviltrout.com</a><br>")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue