diff --git a/lib/adamantium/link_finder.rb b/lib/adamantium/link_finder.rb index 7b4d496..a2c84a1 100644 --- a/lib/adamantium/link_finder.rb +++ b/lib/adamantium/link_finder.rb @@ -18,7 +18,7 @@ module Adamantium links.reject do |link| link.end_with?(":") || IGNORE_LIST.include?(URI.parse(link).host) - end + end.map{ |uri| URI(uri) } end end end diff --git a/spec/adamantium/unit/link_finder_spec.rb b/spec/adamantium/unit/link_finder_spec.rb index 196466c..e26b419 100644 --- a/spec/adamantium/unit/link_finder_spec.rb +++ b/spec/adamantium/unit/link_finder_spec.rb @@ -6,6 +6,6 @@ RSpec.describe Adamantium::LinkFinder do it "finds allowed links in a string" do text = "Check out some of these cool websites: https://google.com https://example.com or even http://twitter.com and https://bsky.app" - expect(subject.call(text)).to eq ["https://example.com"] + expect(subject.call(text)).to eq [URI("https://example.com")] end end