lib/ahoy_email/processor.rb in ahoy_email-0.5.1 vs lib/ahoy_email/processor.rb in ahoy_email-0.5.2
- old
+ new
@@ -155,10 +155,14 @@
# Parse href attribute
# Return uri if valid, nil otherwise
def parse_uri(href)
# to_s prevent to return nil from this method
- Addressable::URI.parse(href.to_s) rescue nil
+ if options[:heuristic_parse]
+ Addressable::URI.heuristic_parse(href.to_s) rescue nil
+ else
+ Addressable::URI.parse(href.to_s) rescue nil
+ end
end
def url_for(opt)
opt = (ActionMailer::Base.default_url_options || {})
.merge(options[:url_options])