$this->drupalSettings =
[];
if (preg_match('@<script type="application/json" data-drupal-selector="drupal-settings-json">([^<]*)</script>@',
$content,
$matches)) { $this->drupalSettings = Json::
decode($matches[1
]);
} } /**
* Retrieves the plain-text content from the current raw content.
*/
protected function getTextContent() { if (!
isset($this->plainTextContent
)) { $raw_content =
$this->
getRawContent();
// Strip everything between the HEAD tags.
$raw_content =
preg_replace('@<head>(.+?)</head>@si', '',
$raw_content);
$this->plainTextContent = Xss::
filter($raw_content,
[]);
} return $this->plainTextContent;
} /**
* Removes all white-space between HTML tags from the raw content.
*
* White-space is only removed if there are no non-white-space characters
* between HTML tags.
*
* Use this (once) after performing an operation that sets new raw content,
* and when you want to use e.g. assertText() but ignore potential white-space
* caused by HTML output templates.
*/