Fix issue with falsey hrefs being sent in events (#8113)

This commit is contained in:
Michael Telatynski 2022-03-23 13:38:57 +00:00 committed by GitHub
parent 81df4c0aeb
commit eb668538aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 7 deletions

View file

@ -182,7 +182,11 @@ const transformTags: IExtendedSanitizeOptions["transformTags"] = { // custom to
) {
delete attribs.target;
}
} else {
// Delete the href attrib if it is falsey
delete attribs.href;
}
attribs.rel = 'noreferrer noopener'; // https://mathiasbynens.github.io/rel-noopener/
return { tagName, attribs };
},