Retain attribute dominant-baseline in DOMpurify sanitization

This commit is contained in:
ashishj 2022-04-21 22:02:11 +02:00
parent a6299d8334
commit b472fb4f73
1 changed files with 4 additions and 1 deletions

View File

@ -545,7 +545,10 @@ const render = function (id, _txt, cb, container) {
</iframe>`;
} else {
if (cnf.securityLevel !== 'loose') {
svgCode = DOMPurify.sanitize(svgCode, { ADD_TAGS: ['foreignobject'] });
svgCode = DOMPurify.sanitize(svgCode, {
ADD_TAGS: ['foreignobject'],
ADD_ATTR: ['dominant-baseline'],
});
}
}