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. * 
  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. * @author Paul M. Jones <pmjones@ciaweb.net>
  13. *
  14. * @package Text_Wiki
  15. *
  16. */
  17.  
  18.     
  19.     /**
  20.     * 
  21.     * Constructor.  Overrides the Text_Wiki_Parse constructor so that we
  22.     * can set the $regex property dynamically (we need to include the
  23.     * Text_Wiki $delim character.
  24.     * 
  25.     * @param object &$obj The calling "parent" Text_Wiki object.
  26.     * 
  27.     * @param string $name The token name to use for this rule.
  28.     * 
  29.     */
  30.     
  31.     function Text_Wiki_Parse_delimiter(&$obj)
  32.     {
  33.         parent::Text_Wiki_Parse($obj);
  34.         $this->regex = '/' . $this->wiki->delim . '/';
  35.     }
  36.     
  37.     
  38.     /**
  39.     * 
  40.     * Generates a token entry for the matched text.  Token options are:
  41.     * 
  42.     * 'text' => The full matched text.
  43.     * 
  44.     * @access public
  45.     *
  46.     * @param array &$matches The array of matches from parse().
  47.     *
  48.     * @return A delimited token number to be used as a placeholder in
  49.     *  the source text.
  50.     *
  51.     */
  52.     
  53.     function process(&$matches)
  54.     {    
  55.         return $this->wiki->addToken(
  56.             $this->rule,
  57.             array('text' => $this->wiki->delim)
  58.         );
  59.     }
  60. }
  61. ?>

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