home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / Text / Wiki / Parse / Default / Break.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  1.2 KB  |  72 lines

  1. <?php
  2.  
  3. /**
  4. * Parses for explicit line breaks.
  5. * @category Text
  6. * @package Text_Wiki
  7. * @author Paul M. Jones <pmjones@php.net>
  8. * @license LGPL
  9. * @version $Id: Break.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
  10. */
  11.  
  12. /**
  13. * Parses for explicit line breaks.
  14. * This class implements a Text_Wiki_Parse to mark forced line breaks in the
  15. * source text.
  16. *
  17. * @category Text
  18. * @package Text_Wiki
  19. * @author Paul M. Jones <pmjones@php.net>
  20. */
  21.  
  22. class Text_Wiki_Parse_Break 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 = '/ _\n/';
  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 delimited token to be used as a placeholder in
  50.     * the source text.
  51.     *
  52.     */
  53.     
  54.     function process(&$matches)
  55.     {    
  56.         return $this->wiki->addToken($this->rule);
  57.     }
  58. }
  59.  
  60. ?>