Skip to content

Commit 67ad353

Browse files
Merge branch '6.3' into 6.4
* 6.3: [Process] Fix test case [Workflow] fix MermaidDumper when place contains special char [Crawler] Fix regression where cdata nodes will return empty string [DoctrineBridge] Bugfix - Allow to remove LazyLoaded listeners by object [Messenger] Add forward compatibily with php-amqp v2
2 parents bbd96a9 + 3fdd2a3 commit 67ad353

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Crawler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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) {

Tests/AbstractCrawlerTestCase.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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>

0 commit comments

Comments
 (0)