about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2020-10-18 13:46:56 -0500
committerStarfall <us@starfall.systems>2020-10-18 13:46:56 -0500
commitab2148ef84c2880465599bd8c80e15378cf0a517 (patch)
treeb9c55ad43c81e97e4c378f95253a6a546d8796d8 /app/lib
parent220958fc9fff236e61560f20079be28dea7e23fc (diff)
parent311f457430e4863f3c74fe6e222a96f62fc0148d (diff)
Merge branch 'glitch' into main
Diffstat (limited to 'app/lib')
-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 c0f7866bf..e7bb0743d 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