includes/wikiengine/Parse/Mediawiki/Break.php
changeset 1027 98c052fc3337
parent 1026 f0431eb8161e
child 1028 dde4416dea00
equal deleted inserted replaced
1026:f0431eb8161e 1027:98c052fc3337
     1 <?php
       
     2 
       
     3 /**
       
     4 * 
       
     5 * Parses for explicit line breaks.
       
     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: Break.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
       
    16 * 
       
    17 */
       
    18 
       
    19 /**
       
    20 * 
       
    21 * Parses for explicit line breaks.
       
    22 * 
       
    23 * This class implements a Text_Wiki_Parse to mark forced line breaks in the
       
    24 * source text.
       
    25 *
       
    26 * @category Text
       
    27 * 
       
    28 * @package Text_Wiki
       
    29 * 
       
    30 * @author Paul M. Jones <pmjones@php.net>
       
    31 * 
       
    32 */
       
    33 
       
    34 class Text_Wiki_Parse_Break 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 = '/ _\n/';
       
    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 delimited token to be used as a placeholder in
       
    62     * the source text.
       
    63     *
       
    64     */
       
    65     
       
    66     function process(&$matches)
       
    67     {    
       
    68         return $this->wiki->addToken($this->rule);
       
    69     }
       
    70 }
       
    71 
       
    72 ?>