From dcf52daa9bff27ce0af1882c9eedfc6a3c16ba29 Mon Sep 17 00:00:00 2001 From: KMY Date: Tue, 7 Mar 2023 12:23:09 +0900 Subject: [PATCH] Debug phising code --- lib/sanitize_ext/sanitize_config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sanitize_ext/sanitize_config.rb b/lib/sanitize_ext/sanitize_config.rb index ae5e791338..fdcb0c450b 100644 --- a/lib/sanitize_ext/sanitize_config.rb +++ b/lib/sanitize_ext/sanitize_config.rb @@ -64,7 +64,7 @@ class Sanitize :relative 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.before(Nokogiri::XML::Text.new('⚠', current_node.document)) end