FIX: respect nofollow settings for onebox links

This commit is contained in:
Arpit Jalan
2018-03-26 15:54:39 +05:30
parent dcd1d422d1
commit b75b6de982
3 changed files with 23 additions and 0 deletions

View File

@ -454,6 +454,10 @@ class CookedPostProcessor
img.parent["style"] = "--aspect-ratio:#{width}/#{height};"
end
end
if @cooking_options[:omit_nofollow] || !SiteSetting.add_rel_nofollow_to_user_content
@doc.css(".onebox-body a, .onebox a").each { |a| a.remove_attribute("rel") }
end
end
def optimize_urls