8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a9bfff commit de3b59fCopy full SHA for de3b59f
src/parsers/template.js
@@ -126,9 +126,19 @@ function nodeToFragment (node) {
126
) {
127
return node.content
128
}
129
- return tag === 'SCRIPT'
130
- ? stringToFragment(node.textContent)
131
- : stringToFragment(node.innerHTML)
+ // script template
+ if (tag === 'SCRIPT') {
+ return stringToFragment(node.textContent)
132
+ }
133
+ // normal node, clone it to avoid mutating the original
134
+ var clone = exports.clone(node)
135
+ var frag = document.createDocumentFragment()
136
+ var child
137
+ /* jshint boss:true */
138
+ while (child = clone.firstChild) {
139
+ frag.appendChild(child)
140
141
+ return frag
142
143
144
// Test for the presence of the Safari template cloning bug
0 commit comments