Skip to content

Commit 72681ec

Browse files
Merge branch '6.4' into 7.0
* 6.4: (31 commits) [HttpKernel] Strip exception file paths from log messages [Validator] Add ability to validate time without seconds [Process] Fix test case [Process] Support finding executables independently of open_basedir [Mime] Update mimetypes Add some PHPDoc [Workflow] Add a profiler [Form] Removing self-closing slash from `<input>` [FrameworkBundle][Serializer] Add TranslatableNormalizer [Uid] Fix example [HttpKernel] Add `reset()` implementation in DataCollector [Uid] Add more PHP doc to "export" functions [HttpKernel] RequestPayloadValueResolver Add support for custom http status code [Serializer] Add support for seld/jsonlint in order to enhance error messages [Workflow] fix MermaidDumper when place contains special char [Translation] Phrase translation provider [Workflow] Add support for storing the marking in a property [Crawler] Fix regression where cdata nodes will return empty string [Scheduler] make `ScheduledStamp` "send-able" [Serializer] Groups annotation/attribute on class ...
2 parents 5bd3347 + 67ad353 commit 72681ec

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
@@ -564,7 +564,7 @@ public function text(string $default = null, bool $normalizeWhitespace = true):
564564
public function innerText(bool $normalizeWhitespace = true): string
565565
{
566566
foreach ($this->getNode(0)->childNodes as $childNode) {
567-
if (\XML_TEXT_NODE !== $childNode->nodeType) {
567+
if (\XML_TEXT_NODE !== $childNode->nodeType && \XML_CDATA_SECTION_NODE !== $childNode->nodeType) {
568568
continue;
569569
}
570570
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)