5 * Find source text marked for teletype (monospace).
11 * @author Paul M. Jones <pmjones@php.net>
15 * @version $Id: Tt.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
21 * Find source text marked for teletype (monospace).
23 * Defined by text surrounded by two curly braces. On parsing, the text
24 * itself is left in place, but the starting and ending instances of
25 * curly braces are replaced with tokens.
29 * 'type' => ['start'|'end'] The starting or ending point of the
30 * teletype text. The text itself is left in the source.
36 * @author Paul M. Jones <pmjones@php.net>
40 class Text_Wiki_Parse_Tt
extends Text_Wiki_Parse
{
45 * The regular expression used to parse the source text.
55 var $regex = "/{{({*?.*}*?)}}/U";
60 * Generates a replacement for the matched text.
64 * @param array &$matches The array of matches from parse().
66 * @return string A pair of delimited tokens to be used as a
67 * placeholder in the source text surrounding the teletype text.
71 function process(&$matches)
73 $start = $this->wiki
->addToken(
74 $this->rule
, array('type' => 'start')
77 $end = $this->wiki
->addToken(
78 $this->rule
, array('type' => 'end')
81 return $start . $matches[1] . $end;