Skip to content

Commit

Permalink
Retain attribute dominant-baseline in DOMpurify sanitization
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishjain0512 committed Apr 21, 2022
1 parent a6299d8 commit b472fb4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mermaidAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
});
}
}

Expand Down

0 comments on commit b472fb4

Please sign in to comment.