protected function TextPlainUnitTest::getPlainTextContent

Gets the plain-text version of $this->content.

Parameters

string $content: A (HTML) string.

Return value

string The $content with all HTML tags stripped and all HTML entities replaced with their actual characters.

2 calls to TextPlainUnitTest::getPlainTextContent()

File

drupal/core/modules/text/lib/Drupal/text/Tests/Formatter/TextPlainUnitTest.php, line 174
Contains \Drupal\text\Tests\Formatter\TextPlainUnitTest.

Class

TextPlainUnitTest
Tests the text_plain field formatter.

Namespace

Drupal\text\Tests\Formatter

Code

protected function getPlainTextContent($content) {

  // Strip all HTML tags.
  $content = strip_tags($content);

  // Decode all HTML entities (e.g., ' ') into characters.
  $content = html_entity_decode($content, ENT_QUOTES, 'UTF-8');
  return $content;
}