Skip to content

Commit

Permalink
allow attribute id in div tag
Browse files Browse the repository at this point in the history
  • Loading branch information
only-dev-time committed Mar 12, 2023
1 parent 531b163 commit b2a8e27
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/utils/SanitizeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default ({

// class attribute is strictly whitelisted (below)
// and title is only set in the case of a phishing warning
div: ['class', 'title'],
div: ['class', 'title', 'id'],

// style is subject to attack, filtering more below
td: ['style'],
Expand Down Expand Up @@ -183,6 +183,10 @@ export default ({
attribs.title === getPhishingWarningMessage()
)
attys.title = attribs.title;
// allow intern anchor with attribute 'id' - only if the 'id' begins with 'anchor'
if (attribs.id && attribs.id.indexOf('anchor') == 0) {
attys.id = attribs.id;
}
return {
tagName,
attribs: attys,
Expand Down

0 comments on commit b2a8e27

Please sign in to comment.