Source for file Trim.php
Documentation is available at Trim.php
* Trim lines in the source text and compress 3 or more newlines to
* @author Paul M. Jones <pmjones@php.net>
* @author Michele Tomaiuolo <tomamic@yahoo.it>
$this->wiki->source = preg_replace($find, $replace, $this->wiki->source );
// trim lines with only one dash or star
$this->wiki->source = preg_replace($find, $replace, $this->wiki->source );
// finally, compress all instances of 3 or more newlines
$this->wiki->source = preg_replace($find, $replace, $this->wiki->source );
$find = "/(\n[\*\#]*)([\d]+[\.\)]|[\w]\)) /s";
$this->wiki->source = preg_replace($find, $replace, $this->wiki->source );
// numbers in parentesis are footnotes and references
$find = "/\(([\d][\d]?)\)/";
$this->wiki->source = preg_replace($find, $replace, $this->wiki->source );
// add hr before footnotes
$find = "/(\n+\-\-\-\-+\n*)?(\n\[[\d]+\].*)/s";
$replace = "\n\n----\n\n$2";
$this->wiki->source = preg_replace($find, $replace, $this->wiki->source );
$find = "/(?<=\n\n){{([^\|}]*)\|([^}]*)}}(?=\n\n)/";
$replace = "| {{ $1 | $2 }}\n|= $2";
$this->wiki->source = preg_replace($find, $replace, $this->wiki->source);
$find = "/(?<=\n\n){{([^\|}]*)}}(?=\n\n)/";
$this->wiki->source = preg_replace($find, $replace, $this->wiki->source);
Documentation generated on Mon, 11 Mar 2019 15:40:31 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|