You are here

private static function XBBCodeStandardTest::stripSpaces in Extensible BBCode 8.3

Same name and namespace in other branches
  1. 4.0.x 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 298

Class

XBBCodeStandardTest
Class XBBCodeStandardTest.

Namespace

Drupal\Tests\xbbcode_standard\Kernel

Code

private static function stripSpaces($html) : string {
  return preg_replace('/(?<=^|>)\\s+(?=<|$)/', '', $html);
}