]> git.openstreetmap.org Git - rails.git/blobdiff - lib/rich_text.rb
Merge pull request #3676 from harry-wood/notes-disappear-time
[rails.git] / lib / rich_text.rb
index 1de7b882b2ae0da6cf7aa6e22557d9b547ac3431..a0c4d9c8debc70fb3a39c6a32d7ffecf7b9aa867 100644 (file)
@@ -44,9 +44,9 @@ module RichText
         doc.content.include?(phrase)
       end
 
-      [link_proportion - 0.2, 0.0].max * 200 +
-        link_count * 40 +
-        spammy_phrases * 40
+      ([link_proportion - 0.2, 0.0].max * 200) +
+        (link_count * 40) +
+        (spammy_phrases * 40)
     end
 
     protected
@@ -61,9 +61,9 @@ module RichText
 
     def linkify(text, mode = :urls)
       if text.html_safe?
-        Rinku.auto_link(text, mode, tag_builder.tag_options(:rel => "nofollow noopener noreferer")).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 noreferer"))
+        Rinku.auto_link(text, mode, tag_builder.tag_options(:rel => "nofollow noopener noreferrer"))
       end
     end
   end