Skip to content

Commit 2c7d95d

Browse files
committed
copy over all attributes
1 parent adea3ca commit 2c7d95d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/svelte/src/internal/client/reconciler.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ export function create_fragment_with_script_from_html(html) {
1919
var scripts = content.querySelectorAll('script');
2020
for (const script of scripts) {
2121
var newScript = document.createElement('script');
22-
if (script.src) {
23-
newScript.src = script.src;
24-
} else {
25-
newScript.textContent = script.textContent;
22+
for (var i = 0; i < script.attributes.length; i++) {
23+
newScript.setAttribute(script.attributes[i].name, script.attributes[i].value);
2624
}
25+
newScript.textContent = script.textContent;
2726
/** @type {Node} */ (script.parentNode).replaceChild(newScript, script);
2827
}
2928
return content;

0 commit comments

Comments
 (0)