In DIV elements, Ps are only added when there would be at least two of them.
Beispiel #1
0
 /**
  * @dataProvider provider
  */
 public function testProcess($test, $in, $exp)
 {
     $exp = $this->flattenString($exp);
     $out = $this->_autop->process($in);
     $out = $this->flattenString($out);
     $this->assertEquals($exp, $out, "Equality case {$test}");
 }
 public function testProcess()
 {
     $data = $this->provider();
     foreach ($data as $row) {
         list($test, $in, $exp) = $row;
         $exp = $this->flattenString($exp);
         $out = $this->_autop->process($in);
         $out = $this->flattenString($out);
         $this->assertEqual($exp, $out, "Equality case {$test}");
     }
 }
Beispiel #3
0
 /**
  * Singleton pattern.
  * @return ElggAutoP
  */
 public static function getInstance()
 {
     $className = __CLASS__;
     if (!self::$instance instanceof $className) {
         self::$instance = new $className();
     }
     return self::$instance;
 }
Beispiel #4
0
/**
 * Create paragraphs from text with line spacing
 *
 * @param string $string The string
 *
 * @return string
 **/
function elgg_autop($string)
{
    return ElggAutoP::getInstance()->process($string);
}