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

Documentation generated on Mon, 11 Mar 2019 13:56:09 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.