Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

AO3-4200 Add rel=nofollow to links to reduce SEO usefulness for spammers #3137

Merged
merged 3 commits into from Nov 4, 2017
@@ -27,6 +27,10 @@ module Config
'th' => ['abbr', 'axis', 'colspan', 'height', 'rowspan', 'scope', 'width'],
'ul' => ['type'],
},
+
+ add_attributes: {
+ 'a' => {'rel' => 'nofollow'}
@houndci-bot

houndci-bot Nov 2, 2017

Space inside { missing.
Space inside } missing.

+ },
protocols: {
'a' => {'href' => ['ftp', 'http', 'https', 'mailto', :relative]},
View
@@ -25,7 +25,6 @@ def close_tag(node, attributes=nil)
self_closing = node.children.empty?
rescue NameError
name = node
- attributes ||= {}
self_closing = false
end
@@ -124,13 +123,6 @@ def fix_bad_characters(text)
# convert carriage returns to newlines
text.gsub!(/\r\n?/, "\n")
- # replace curlyquotes
- # note: turns out not to be necessary?
- # text.gsub! "\xE2\x80\x98", "'"
- # text.gsub! "\xE2\x80\x99", "'"
- # text.gsub! "\xE2\x80\x9C", '"'
- # text.gsub! "\xE2\x80\x9D", '"'
-
# argh, get rid of ____spacer____ inserts
text.gsub! "____spacer____", ""
@@ -271,7 +263,7 @@ def traverse_nodes(node, stack=nil, out_html=nil)
return [stack, out_html]
end
- # Don't decend into node if we don't want to touch the content of
+ # Don't descend into node if we don't want to touch the content of
# this kind of tag
if dont_touch_content_tag?(node.name)
if put_inside_p_tag?(node.name) && !stack.inside_paragraph?
Oops, something went wrong.