Fix link sanitization for outgoing text/html and text/markdown toots
Fixes #1739
This commit is contained in:
@ -133,7 +133,7 @@ class Sanitize
|
||||
rel += ['nofollow', 'noopener', 'noreferrer'] unless TagManager.instance.local_url?(node['href'])
|
||||
|
||||
if rel.empty?
|
||||
node['rel']&.delete
|
||||
node.remove_attribute('rel')
|
||||
else
|
||||
node['rel'] = rel.join(' ')
|
||||
end
|
||||
@ -144,7 +144,7 @@ class Sanitize
|
||||
|
||||
node = env[:node]
|
||||
if node['target'] != '_blank' && TagManager.instance.local_url?(node['href'])
|
||||
node['target']&.delete
|
||||
node.remove_attribute('target')
|
||||
else
|
||||
node['target'] = '_blank'
|
||||
end
|
||||
|
Reference in New Issue
Block a user