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

Source for file Delimiter.php

Documentation is available at Delimiter.php

  1. <?php
  2.  
  3. /**
  4.  *
  5.  * Parses for Text_Wiki delimiter characters already in the source text.
  6.  *
  7.  * This class implements a Text_Wiki_Parse to find instances of the delimiter
  8.  * character already embedded in the source text; it extracts them and replaces
  9.  * them with a delimited token, then renders them as the delimiter itself
  10.  * when the target format is XHTML.
  11.  *
  12.  * @category Text
  13.  *
  14.  * @package Text_Wiki
  15.  *
  16.  * @author Paul M. Jones <pmjones@php.net>
  17.  *
  18.  * @license LGPL
  19.  *
  20.  * @version $Id: Delimiter.php 222265 2006-10-23 13:11:27Z mic $
  21.  *
  22.  */
  23.  
  24. class Text_Wiki_Parse_Delimiter extends Text_Wiki_Parse {
  25.  
  26.     /**
  27.      *
  28.      * Constructor.  Overrides the Text_Wiki_Parse constructor so that we
  29.      * can set the $regex property dynamically (we need to include the
  30.      * Text_Wiki $delim character.
  31.      *
  32.      * @param object &$obj The calling "parent" Text_Wiki object.
  33.      *
  34.      * @param string $name The token name to use for this rule.
  35.      *
  36.      */
  37.  
  38.     function Text_Wiki_Parse_Delimiter(&$obj)
  39.     {
  40.         parent::Text_Wiki_Parse($obj);
  41.         $this->regex '/' $this->wiki->delim . '/';
  42.     }
  43.  
  44.  
  45.     /**
  46.      *
  47.      * Generates a token entry for the matched text.  Token options are:
  48.      *
  49.      * 'text' => The full matched text.
  50.      *
  51.      * @access public
  52.      *
  53.      * @param array &$matches The array of matches from parse().
  54.      *
  55.      * @return delimited token number to be used as a placeholder in
  56.      *  the source text.
  57.      *
  58.      */
  59.  
  60.     function process(&$matches)
  61.     {
  62.         return $this->wiki->addToken(
  63.             $this->rule,
  64.             array('text' => $this->wiki->delim)
  65.         );
  66.     }
  67. }
  68. ?>

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