private static function XBBCodeStandardTest::stripSpaces in Extensible BBCode 4.0.x
Same name and namespace in other branches
- 8.3 standard/tests/src/Kernel/XBBCodeStandardTest.php \Drupal\Tests\xbbcode_standard\Kernel\XBBCodeStandardTest::stripSpaces()
Strip interstitial white space between tags.
This produces a normal form for templates that use odd indentation.
Parameters
string $html: The HTML input.
Return value
string The HTML with all the following whitespace removed:
- between > and <
- between the start and <
- between > and the end
1 call to XBBCodeStandardTest::stripSpaces()
- XBBCodeStandardTest::testTags in standard/
tests/ src/ Kernel/ XBBCodeStandardTest.php - Test all of the tags installed by this module.
File
- standard/
tests/ src/ Kernel/ XBBCodeStandardTest.php, line 296
Class
- XBBCodeStandardTest
- Test the standard tags provided by XBBCode.
Namespace
Drupal\Tests\xbbcode_standard\KernelCode
private static function stripSpaces(string $html) : string {
return preg_replace('/(?<=^|>)\\s+(?=<|$)/', '', $html);
}