Skip to content

Commit

Permalink
Update src/utils.js
Browse files Browse the repository at this point in the history
Co-authored-by: Emanuele <[email protected]>
  • Loading branch information
axlwaii and LostCrew authored Oct 17, 2023
1 parent 308867f commit 5b79436
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 @@ -28,7 +28,7 @@ export const sanitizeHTML = (htmlString, allowedTags = [], allowedAttributes = [
const allowedAttrs = attrs.split(/\s+/)
.filter(attr => allowedAttributes.includes(attr.split('=')[0]))
.join(' ');
return `<${tagName}${allowedAttrs ? ' ' + allowedAttrs : ''}>`;
return `<${tagName}${allowedAttrs ? ` ${allowedAttrs}` : ''}>`;
}
// If the tag is not allowed, strip it completely.
return '';
Expand Down

0 comments on commit 5b79436

Please sign in to comment.