]> git.openstreetmap.org Git - rails.git/blobdiff - lib/rich_text.rb
Remove html-safe/unsafe branches from rich text linkify
[rails.git] / lib / rich_text.rb
index c20f973b12286164b56fcfc9f8eb47ac2fe0645d..d6df214d1b0340c532b31cb1c57ced394ae397f1 100644 (file)
@@ -76,11 +76,7 @@ module RichText
     end
 
     def linkify(text, mode = :urls)
-      if text.html_safe?
-        Rinku.auto_link(text, mode, tag_builder.tag_options(:rel => "nofollow noopener noreferrer")).html_safe
-      else
-        Rinku.auto_link(text, mode, tag_builder.tag_options(:rel => "nofollow noopener noreferrer"))
-      end
+      Rinku.auto_link(ERB::Util.html_escape(text), mode, tag_builder.tag_options(:rel => "nofollow noopener noreferrer")).html_safe
     end
   end