Use _blank for the target

Some browsers might interpret "blank" as a named frame. You might want to consider using the browser standard _blank

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target
This commit is contained in:
Daryl Fritz 2022-06-14 20:50:09 +00:00 committed by GitHub
parent 95e983d9d2
commit e4995bae97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ def convert_links(doc)
if open_external_links_in_new_tab
parsed_doc = Nokogiri::HTML(doc.content)
parsed_doc.css("a:not(.internal-link):not(.footnote):not(.reversefootnote)").each do |link|
link.set_attribute('target', 'blank')
link.set_attribute('target', '_blank')
end
doc.content = parsed_doc.to_html
end