about summary refs log tree commit diff
path: root/app/lib/formatter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib/formatter.rb')
-rw-r--r--app/lib/formatter.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index 159e3ec54..e0c1e94db 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -11,6 +11,8 @@ class HTMLRenderer < Redcarpet::Render::HTML
   def autolink(link, link_type)
     return link if link_type == :email
     Formatter.instance.link_url(link)
+  rescue Addressable::URI::InvalidURIError, IDN::Idna::IdnaError
+    encode(link)
   end
 
   private