Text_Wiki
[ class tree: Text_Wiki ] [ index: Text_Wiki ] [ all elements ]

Source for file Horiz.php

Documentation is available at Horiz.php

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

Documentation generated on Mon, 11 Mar 2019 15:40:30 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.