DOMPurify 3.3.0 will soon be released, with this likely being the most important change in a long time:

GitHub
Allow ADD_ATTR and ADD_TAGS to accept a function by nelstrom ยท Pull Request #1150 ยท cure53/DOMPurify
Summary
This PR addresses issue #1149 by allowing ADD_ATTR to accept a function for tag-specific attribute validation.
Background & Context
Cur...