class InstallDocFormatter {
static function format( $text ) {
$obj = new self( $text );
+
return $obj->execute();
}
protected function execute() {
$text = $this->text;
// Use Unix line endings, escape some wikitext stuff
- $text = str_replace( array( '<', '{{', '[[', "\r" ),
- array( '<', '{{', '[[', '' ), $text );
+ $text = str_replace( array( '<', '{{', '[[', '__', "\r" ),
+ array( '<', '{{', '[[', '__', '' ), $text );
// join word-wrapped lines into one
do {
$prev = $text;
// turn (bug nnnn) into links
$text = preg_replace_callback( '/bug (\d+)/', array( $this, 'replaceBugLinks' ), $text );
// add links to manual to every global variable mentioned
- $text = preg_replace_callback( '/(\$wg[a-z0-9_]+)/i', array( $this, 'replaceConfigLinks' ), $text );
+ $text = preg_replace_callback(
+ '/(\$wg[a-z0-9_]+)/i',
+ array( $this, 'replaceConfigLinks' ),
+ $text
+ );
+
return $text;
}