Extension:SimpleTable/1.2

\n\n", " ", $ret->getText) ); # remove superfluous newlines       return $HTML;    }

/*    * Convert tabbed data into a Wiki-markup table body. */   private function convertTable($tabbed, $head, $pattern) { $wikitab = '';

// Remove initial and final newlines. $tabbed = trim($tabbed);

// Split the input into lines, and convert each line to table format. $lines = preg_split('/\n/', $tabbed); $row = 0; foreach ($lines as $line) { $wikitab .= "|-\n"; $bar = strpos($head, 'top') !== false && $row == 0 ? '!' : '|';

$fields = preg_split($pattern, $line); $col = 0; foreach ($fields as $field) { $cbar = strpos($head, 'left') !== false && $col == 0 ? '!' : $bar; $wikitab .= $cbar. " " . $field. "\n"; ++$col; }           ++$row; }       return $wikitab; }

}