Skip to content

Commit f095a6c

Browse files
committed
Another try
1 parent d71a729 commit f095a6c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/courrier/email/providers/inbox.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
require "tmpdir"
44
require "fileutils"
5-
require "uri"
65
require "launchy"
76

87
module Courrier
@@ -40,7 +39,7 @@ def extract(to)
4039
end
4140

4241
def prepare(content)
43-
content.to_s.gsub(URI::RFC2396_PARSER.make_regexp(%w[http https])) do |url|
42+
content.to_s.gsub(URL_PARSER.make_regexp(%w[http https])) do |url|
4443
%(<a href="#{url}">#{url}</a>)
4544
end
4645
end
@@ -59,6 +58,10 @@ def email_destination
5958
"available at #{path}"
6059
end
6160

61+
URL_PARSER = (
62+
defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::DEFAULT_PARSER
63+
)
64+
6265
class Email < Data.define(:path, :filename, :metadata)
6366
Metadata = Data.define(:to, :subject)
6467

0 commit comments

Comments
 (0)