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');