Skip to content

Commit

Permalink
Merge branch '6.4' into 7.0
Browse files Browse the repository at this point in the history
* 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
  ...
  • Loading branch information
nicolas-grekas committed Aug 1, 2023
2 parents 5bd3347 + 67ad353 commit 72681ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ public function text(string $default = null, bool $normalizeWhitespace = true):
public function innerText(bool $normalizeWhitespace = true): string
{
foreach ($this->getNode(0)->childNodes as $childNode) {
if (\XML_TEXT_NODE !== $childNode->nodeType) {
if (\XML_TEXT_NODE !== $childNode->nodeType && \XML_CDATA_SECTION_NODE !== $childNode->nodeType) {
continue;
}
if (!$normalizeWhitespace) {
Expand Down
7 changes: 7 additions & 0 deletions Tests/AbstractCrawlerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,12 @@ public static function provideInnerTextExamples()
'',
' ',
],
[
'//*[@id="complex-elements"]/*[@class="six"]',
'console.log("Test JavaScript content");',
'console.log("Test JavaScript content");',
' console.log("Test JavaScript content"); ',
],
];
}

Expand Down Expand Up @@ -1311,6 +1317,7 @@ public function createTestCrawler($uri = null)
<div class="three"> Parent text <span>Child text</span> Parent text </div>
<div class="four"> <span>Child text</span> </div>
<div class="five"><span>Child text</span> <span>Another child</span></div>
<script class="six" type="text/javascript"> console.log("Test JavaScript content"); </script>
</div>
</body>
</html>
Expand Down

0 comments on commit 72681ec

Please sign in to comment.