5 * Parses for Text_Wiki delimiter characters already in the source text.
11 * @author Paul M. Jones <pmjones@php.net>
15 * @version $Id: Delimiter.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
21 * Parses for Text_Wiki delimiter characters already in the source text.
23 * This class implements a Text_Wiki_Parse to find instances of the delimiter
24 * character already embedded in the source text; it extracts them and replaces
25 * them with a delimited token, then renders them as the delimiter itself
26 * when the target format is XHTML.
32 * @author Paul M. Jones <pmjones@php.net>
36 class Text_Wiki_Parse_Delimiter
extends Text_Wiki_Parse
{
40 * Constructor. Overrides the Text_Wiki_Parse constructor so that we
41 * can set the $regex property dynamically (we need to include the
42 * Text_Wiki $delim character.
44 * @param object &$obj The calling "parent" Text_Wiki object.
46 * @param string $name The token name to use for this rule.
50 function Text_Wiki_Parse_delimiter(&$obj)
52 parent
::Text_Wiki_Parse($obj);
53 $this->regex
= '/' . $this->wiki
->delim
. '/';
59 * Generates a token entry for the matched text. Token options are:
61 * 'text' => The full matched text.
65 * @param array &$matches The array of matches from parse().
67 * @return A delimited token number to be used as a placeholder in
72 function process(&$matches)
74 return $this->wiki
->addToken(
76 array('text' => $this->wiki
->delim
)