5 * Parses for centered lines of text.
11 * @author Paul M. Jones <pmjones@php.net>
15 * @version $Id: Center.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
21 * Parses for centered lines of text.
23 * This class implements a Text_Wiki_Parse to find lines marked for centering.
24 * The line must start with "= " (i.e., an equal-sign followed by a space).
30 * @author Paul M. Jones <pmjones@php.net>
34 class Text_Wiki_Parse_Center
extends Text_Wiki_Parse
{
39 * The regular expression used to find source text matching this
48 var $regex = '/\n\= (.*?)\n/';
52 * Generates a token entry for the matched text.
56 * @param array &$matches The array of matches from parse().
58 * @return A delimited token number to be used as a placeholder in
63 function process(&$matches)
65 $start = $this->wiki
->addToken(
67 array('type' => 'start')
70 $end = $this->wiki
->addToken(
72 array('type' => 'end')
75 return "\n" . $start . $matches[1] . $end . "\n";