mirror of https://gitee.com/answerdev/answer.git
fix(Customize/CSS-HTML): When copy the script text, also copy the script attributes
This commit is contained in:
parent
65059229bb
commit
8f38a18512
|
@ -34,7 +34,11 @@ const ActivateScriptNodes = (el, part) => {
|
|||
}
|
||||
scriptList.forEach((so) => {
|
||||
const script = document.createElement('script');
|
||||
script.textContent = so.textContent;
|
||||
script.text = so.text;
|
||||
for (let i = 0; i < so.attributes.length; i += 1) {
|
||||
const attr = so.attributes[i];
|
||||
script.setAttribute(attr.name, attr.value);
|
||||
}
|
||||
el.replaceChild(script, so);
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue