Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
axlwaii committed Oct 17, 2023
1 parent 5b79436 commit 1b31d26
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const sanitizeHTML = (htmlString, allowedTags = [], allowedAttributes = [
return '';
}

if(allowedTags.length === 0) {
if (allowedTags.length === 0) {
return removeAllTags(htmlString);
}

Expand All @@ -26,8 +26,8 @@ export const sanitizeHTML = (htmlString, allowedTags = [], allowedAttributes = [
}
// Otherwise, reconstruct the opening tag with only allowed attributes.
const allowedAttrs = attrs.split(/\s+/)
.filter(attr => allowedAttributes.includes(attr.split('=')[0]))
.join(' ');
.filter((attr) => allowedAttributes.includes(attr.split('=')[0]))
.join(' ');
return `<${tagName}${allowedAttrs ? ` ${allowedAttrs}` : ''}>`;
}
// If the tag is not allowed, strip it completely.
Expand Down

0 comments on commit 1b31d26

Please sign in to comment.