Debug phising code

This commit is contained in:
KMY 2023-03-07 12:23:09 +09:00
parent a5c3cb4b42
commit dcf52daa9b

View file

@ -64,7 +64,7 @@ class Sanitize
:relative :relative
end end
if LINK_PROTOCOLS.include?(scheme) && href != text && href != 'https://' + text && cls == '' if LINK_PROTOCOLS.include?(scheme) && href != text && href != 'https://' + text && !text.start_with?('#') && !text.start_with?('@')
current_node['class'] = cls + ' kmy-dangerous-link' current_node['class'] = cls + ' kmy-dangerous-link'
current_node.before(Nokogiri::XML::Text.new('⚠', current_node.document)) current_node.before(Nokogiri::XML::Text.new('⚠', current_node.document))
end end