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.  
  3. /**
  4.  *
  5.  * Parses for implied line breaks indicated by newlines.
  6.  * Newlines are not considered if followed by another newline
  7.  * or by one of these chars: * | - # = {
  8.  *
  9.  * @category Text
  10.  *
  11.  * @package Text_Wiki
  12.  *
  13.  * @author Michele Tomaiuolo <tomamic@yahoo.it>
  14.  *
  15.  * @license LGPL
  16.  *
  17.  * @version $Id: Newline.php 240560 2007-08-01 11:00:11Z mic $
  18.  *
  19.  */
  20.  
  21. class Text_Wiki_Parse_Newline extends Text_Wiki_Parse {
  22.  
  23.  
  24.     /**
  25.      *
  26.      * The regular expression used to parse the source text and find
  27.      * matches conforming to this rule.  Used by the parse() method.
  28.      *
  29.      * @access public
  30.      *
  31.      * @var string 
  32.      *
  33.      * @see parse()
  34.      *
  35.      */
  36.  
  37.     //var $regex = '/(?<!\n)\n(?![\n\#\=\|\-\>\:]|\*[^\*\#]|\*+ )/m';
  38.     var $regex = '/(?<!\n)\n(?!\n|\#|\*|\=|\||\>|\:|\;|\!|\-\D)/m';
  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. ?>

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