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

Source for file Newline.php

Documentation is available at Newline.php

  1. <?php
  2. // $Id: Newline.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 mark implied line breaks in the
  8. * source text, usually a single carriage return in the middle of a paragraph
  9. * or block-quoted text.
  10. *
  11. * @author Paul M. Jones <pmjones@ciaweb.net>
  12. *
  13. * @package Text_Wiki
  14. *
  15. */
  16.  
  17.     
  18.     
  19.     /**
  20.     * 
  21.     * The regular expression used to parse the source text and find
  22.     * matches conforming to this rule.  Used by the parse() method.
  23.     * 
  24.     * @access public
  25.     * 
  26.     * @var string 
  27.     * 
  28.     * @see parse()
  29.     * 
  30.     */
  31.     
  32.     var $regex = '/([^\n])\n([^\n])/m';
  33.     
  34.     
  35.     /**
  36.     * 
  37.     * Generates a replacement token for the matched text.
  38.     * 
  39.     * @access public
  40.     *
  41.     * @param array &$matches The array of matches from parse().
  42.     *
  43.     * @return string A delimited token to be used as a placeholder in
  44.     *  the source text.
  45.     *
  46.     */
  47.     
  48.     function process(&$matches)
  49.     {    
  50.         return $matches[1] .
  51.             $this->wiki->addToken($this->rule) .
  52.             $matches[2];
  53.     }
  54. }
  55.  
  56. ?>

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