rel: 'nofollow noopener',
}
Twitter::Autolink.send(:link_to_text, entity, link_html(entity[:url]), normalized_url, html_attrs)
+ rescue Addressable::URI::InvalidURIError
+ encode(entity[:url])
end
def link_to_mention(entity, mentions)
expect(subject).to match '<p><img src="javascript:alert('XSS');"></p>'
end
end
+
+ context 'contains invalid URL' do
+ let(:local_text) { 'http://www\.google\.com' }
+ it 'has valid url' do
+ expect(subject).to eq '<p>http://www\.google\.com</p>'
+ end
+ end
end
describe '#reformat' do