From cc713dab213f0bff18cd4240048b0002a788ba74 Mon Sep 17 00:00:00 2001 From: Slava Leleka Date: Mon, 19 Feb 2024 19:11:12 +0300 Subject: [PATCH] Use toLowerCase() method --- src/scriptlets/href-sanitizer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scriptlets/href-sanitizer.js b/src/scriptlets/href-sanitizer.js index d9ccc3052..9c5707342 100644 --- a/src/scriptlets/href-sanitizer.js +++ b/src/scriptlets/href-sanitizer.js @@ -174,7 +174,7 @@ export function hrefSanitizer(source, selector, attribute = 'text') { for (let index = 0; index < elements.length; index += 1) { try { const element = elements[index]; - if (element.nodeName !== 'A' || element.hasAttribute('href') === false) { + if (element.nodeName.toLowerCase() !== 'a' || !element.hasAttribute('href')) { continue; } const href = element.getAttribute('href');