FIX: Email cooker should link links that don't begin a line
This commit is contained in:
parent
57f1bf1ddd
commit
6db50b820d
|
@ -3,7 +3,7 @@
|
|||
class EmailCook
|
||||
|
||||
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
|
||||
|
||||
def initialize(raw)
|
||||
|
|
|
@ -30,4 +30,8 @@ LONG_COOKED
|
|||
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>")
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue