File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -588,7 +588,7 @@ public function innerText(/* bool $normalizeWhitespace = true */): string
588588 $ normalizeWhitespace = 1 <= \func_num_args () ? func_get_arg (0 ) : true ;
589589
590590 foreach ($ this ->getNode (0 )->childNodes as $ childNode ) {
591- if (\XML_TEXT_NODE !== $ childNode ->nodeType ) {
591+ if (\XML_TEXT_NODE !== $ childNode ->nodeType && \ XML_CDATA_SECTION_NODE !== $ childNode -> nodeType ) {
592592 continue ;
593593 }
594594 if (!$ normalizeWhitespace ) {
Original file line number Diff line number Diff line change @@ -377,6 +377,12 @@ public static function provideInnerTextExamples()
377377 '' ,
378378 ' ' ,
379379 ],
380+ [
381+ '//*[@id="complex-elements"]/*[@class="six"] ' ,
382+ 'console.log("Test JavaScript content"); ' ,
383+ 'console.log("Test JavaScript content"); ' ,
384+ ' console.log("Test JavaScript content"); ' ,
385+ ],
380386 ];
381387 }
382388
@@ -1311,6 +1317,7 @@ public function createTestCrawler($uri = null)
13111317 <div class="three"> Parent text <span>Child text</span> Parent text </div>
13121318 <div class="four"> <span>Child text</span> </div>
13131319 <div class="five"><span>Child text</span> <span>Another child</span></div>
1320+ <script class="six" type="text/javascript"> console.log("Test JavaScript content"); </script>
13141321 </div>
13151322 </body>
13161323 </html>
You can’t perform that action at this time.
0 commit comments