Skip to content

Commit

Permalink
samclarke#901: allows inserting custom html tags
Browse files Browse the repository at this point in the history
  • Loading branch information
codertushar committed Feb 20, 2023
1 parent 91c3c61 commit 3b1bfec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lib/SCEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,13 @@ export default function SCEditor(original, userOptions) {
* @private
*/
function sanitize(html) {
const allowedTags = ['iframe'].concat(options.allowedTags);
const allowedAttr = ['allowfullscreen', 'frameborder', 'target']
.concat(options.allowedAttributes);

return domPurify.sanitize(html, {
ADD_TAGS: ['iframe'],
ADD_ATTR: ['allowfullscreen', 'frameborder', 'target']
ADD_TAGS: allowedTags,
ADD_ATTR: allowedAttr
});
};

Expand Down

0 comments on commit 3b1bfec

Please sign in to comment.