import of Diogenes 0.9.18
[diogenes.git] / include / Text / Wiki / Parse / Default / Horiz.php
CommitLineData
6855525e
JL
1<?php
2
3/**
4*
5* Parses for horizontal ruling lines.
6*
7* @category Text
8*
9* @package Text_Wiki
10*
11* @author Paul M. Jones <pmjones@php.net>
12*
13* @license LGPL
14*
15* @version $Id: Horiz.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
16*
17*/
18
19/**
20*
21* Parses for horizontal ruling lines.
22*
23* This class implements a Text_Wiki_Parse to find source text marked to
24* be a horizontal rule, as defined by four dashed on their own line.
25*
26* @category Text
27*
28* @package Text_Wiki
29*
30* @author Paul M. Jones <pmjones@php.net>
31*
32*/
33
34class Text_Wiki_Parse_Horiz extends Text_Wiki_Parse {
35
36
37 /**
38 *
39 * The regular expression used to parse the source text and find
40 * matches conforming to this rule. Used by the parse() method.
41 *
42 * @access public
43 *
44 * @var string
45 *
46 * @see parse()
47 *
48 */
49
50 var $regex = '/^([-]{4,})$/m';
51
52
53 /**
54 *
55 * Generates a replacement token for the matched text.
56 *
57 * @access public
58 *
59 * @param array &$matches The array of matches from parse().
60 *
61 * @return string A token marking the horizontal rule.
62 *
63 */
64
65 function process(&$matches)
66 {
67 return $this->wiki->addToken($this->rule);
68 }
69}
70?>