@@ -83,27 +83,27 @@ public function process($html)
8383 $ componentBodyChildrenCount = $ componentBodyElement ->childNodes ->length ;
8484
8585 // keep scripts at the bottom
86- $ scriptElementsMovedIndexes = [];
87- for ($ j = $ componentBodyChildrenCount - 1 ; $ j >= 0 ; $ j --) {
88- $ componentChild = $ componentBodyElement ->childNodes ->item ($ j );
89- if ($ componentChild instanceof DOMText) {
90- continue ;
91- }
92- if ($ componentChild instanceof DOMElement && $ componentChild ->tagName === 'script ' ) {
93- $ componentChildAttributes = $ this ->getDOMElementAttributes ($ componentChild );
94- if (!isset ($ componentChildAttributes ['type ' ]) || $ componentChildAttributes ['type ' ] === '' || $ componentChildAttributes ['type ' ] === 'text/javascript ' ) {
95- $ domBodyElement ->appendChild ($ domDocument ->importNode ($ componentChild , true ));
96- $ scriptElementsMovedIndexes [$ j ] = 1 ;
97- }
98- } else {
99- break ;
100- }
101- }
86+ // $scriptElementsMovedIndexes = [];
87+ // for ($j = $componentBodyChildrenCount - 1; $j >= 0; $j--) {
88+ // $componentChild = $componentBodyElement->childNodes->item($j);
89+ // if ($componentChild instanceof DOMText) {
90+ // continue;
91+ // }
92+ // if ($componentChild instanceof DOMElement && $componentChild->tagName === 'script') {
93+ // $componentChildAttributes = $this->getDOMElementAttributes($componentChild);
94+ // if (!isset($componentChildAttributes['type']) || $componentChildAttributes['type'] === '' || $componentChildAttributes['type'] === 'text/javascript') {
95+ // $domBodyElement->appendChild($domDocument->importNode($componentChild, true));
96+ // $scriptElementsMovedIndexes[$j] = 1;
97+ // }
98+ // } else {
99+ // break;
100+ // }
101+ // }
102102
103103 for ($ j = 0 ; $ j < $ componentBodyChildrenCount ; $ j ++) {
104- if (!isset ($ scriptElementsMovedIndexes [$ j ])) {
105- $ component ->parentNode ->insertBefore ($ domDocument ->importNode ($ componentBodyElement ->childNodes ->item ($ j ), true ), $ component );
106- }
104+ // if (!isset($scriptElementsMovedIndexes[$j])) {
105+ $ component ->parentNode ->insertBefore ($ domDocument ->importNode ($ componentBodyElement ->childNodes ->item ($ j ), true ), $ component );
106+ // }
107107 }
108108
109109 // add head elements
0 commit comments