Don't use innerhtml to inject svg
This commit is contained in:
parent
db09fe9d79
commit
a3a2e52961
@ -108,7 +108,9 @@ const buttonGenerator = (textarea, parent, label, blocking) => {
|
||||
const button = document.createElement('button');
|
||||
const semLabel = semanticLabels[label];
|
||||
button.setAttribute('data-tooltip-content', semLabel.text + semLabel.description);
|
||||
button.innerHTML = semLabel.icon;
|
||||
const parser = new DOMParser();
|
||||
const doc = parser.parseFromString(semLabel.icon, 'image/svg+xml');
|
||||
button.appendChild(doc.children[0]);
|
||||
|
||||
if (blocking) {
|
||||
button.classList.add('blocking');
|
||||
|
Loading…
Reference in New Issue
Block a user