Skip to content

Commit

Permalink
Use toLowerCase() method
Browse files Browse the repository at this point in the history
  • Loading branch information
slavaleleka authored and AdamWr committed Feb 19, 2024
1 parent f95464a commit cc713da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scriptlets/href-sanitizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit cc713da

Please sign in to comment.