Example #1
0
 /**
  * Replace BBCodes and other formatting elements with whitespace
  *
  * NOTE: preserves smilies as text
  *
  * @param  string $xml Parsed text
  * @return string      Plain text
  */
 public function clean_formatting($xml)
 {
     // Insert a space before <s> and <e> then remove formatting
     $xml = preg_replace('#<[es]>#', ' $0', $xml);
     return \s9e\TextFormatter\Utils::removeFormatting($xml);
 }
Example #2
0
 /**
  * @testdox removeFormatting() tests
  * @dataProvider getRemoveFormattingTests
  */
 public function testRemoveFormatting($original, $expected)
 {
     $this->assertSame($expected, Utils::removeFormatting($original));
 }