protected function FilterTest::stripWhitespace in Video Embed Field 8.2
Same name and namespace in other branches
- 8 modules/video_embed_wysiwyg/tests/src/Kernel/FilterTest.php \Drupal\Tests\video_embed_wysiwyg\Kernel\FilterTest::stripWhitespace()
Remove HTML whitespace from a string.
Parameters
string $string: The input string.
Return value
string The whitespace cleaned string.
1 call to FilterTest::stripWhitespace()
- FilterTest::testVideoFilter in modules/
video_embed_wysiwyg/ tests/ src/ Kernel/ FilterTest.php - Test the video ouput.
File
- modules/
video_embed_wysiwyg/ tests/ src/ Kernel/ FilterTest.php, line 126
Class
- FilterTest
- A test for the filter.
Namespace
Drupal\Tests\video_embed_wysiwyg\KernelCode
protected function stripWhitespace($string) {
$no_whitespace = preg_replace('/\\s{2,}/', '', $string);
$no_whitespace = str_replace("\n", '', $no_whitespace);
return $no_whitespace;
}