Skip to content

Commit

Permalink
Use const
Browse files Browse the repository at this point in the history
  • Loading branch information
axlwaii committed Oct 17, 2023
1 parent d61e433 commit 308867f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const sanitizeHTML = (htmlString, allowedTags = [], allowedAttributes = [
return `</${tagName}>`;
}
// Otherwise, reconstruct the opening tag with only allowed attributes.
let allowedAttrs = attrs.split(/\s+/)
const allowedAttrs = attrs.split(/\s+/)
.filter(attr => allowedAttributes.includes(attr.split('=')[0]))
.join(' ');
return `<${tagName}${allowedAttrs ? ' ' + allowedAttrs : ''}>`;
Expand Down

0 comments on commit 308867f

Please sign in to comment.