From 08e94d1b197a053504ce37dbbe03216a80043b10 Mon Sep 17 00:00:00 2001 From: abcang Date: Wed, 10 May 2017 01:17:41 +0900 Subject: Fixed bug that timeline can not be displayed by InvalidURIError (#2947) --- app/lib/formatter.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/lib') diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb index 12b030e11..0f2989a81 100644 --- a/app/lib/formatter.rb +++ b/app/lib/formatter.rb @@ -92,6 +92,8 @@ class Formatter 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) -- cgit