X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/1f3372f52c0aab437926f2904efb00bbb0d63a96..cfb9d537a69df486f9fd4e7d5532a69c2990bf62:/lib/rich_text.rb diff --git a/lib/rich_text.rb b/lib/rich_text.rb index 5b0faae2b..1de7b882b 100644 --- a/lib/rich_text.rb +++ b/lib/rich_text.rb @@ -37,7 +37,7 @@ module RichText link_size += link.content.length end - link_proportion = link_size.to_f / doc.content.length.to_f + link_proportion = link_size.to_f / doc.content.length end spammy_phrases = SPAMMY_PHRASES.count do |phrase| @@ -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")).html_safe + Rinku.auto_link(text, mode, tag_builder.tag_options(:rel => "nofollow noopener noreferer")).html_safe else - Rinku.auto_link(text, mode, tag_builder.tag_options(:rel => "nofollow")) + Rinku.auto_link(text, mode, tag_builder.tag_options(:rel => "nofollow noopener noreferer")) end end end