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

Source for file Tt.php

Documentation is available at Tt.php

  1. <?php
  2.  
  3. /**
  4. * Find source text marked for teletype (monospace).
  5. * Defined by text surrounded by two curly braces. On parsing, the text
  6. * itself is left in place, but the starting and ending instances of
  7. * curly braces are replaced with tokens.
  8. * Token options are:
  9. * 'type' => ['start'|'end'] The starting or ending point of the
  10. * teletype text.  The text itself is left in the source.
  11. * $Id: Tt.php,v 1.2 2004/09/25 19:05:13 pmjones Exp $
  12. @author Paul M. Jones <pmjones@ciaweb.net>
  13. *
  14. @package Text_Wiki
  15. *
  16. */
  17.  
  18.     
  19.     
  20.     /**
  21.     * 
  22.     * The regular expression used to parse the source text.
  23.     * 
  24.     * @access public
  25.     * 
  26.     * @var string 
  27.     * 
  28.     * @see parse()
  29.     * 
  30.     */
  31.     
  32.     var $regex = "/{{({*?.*}*?)}}/U";
  33.     
  34.     
  35.     /**
  36.     * 
  37.     * Generates a replacement for the matched text.
  38.     * 
  39.     * @access public
  40.     *
  41.     * @param array &$matches The array of matches from parse().
  42.     *
  43.     * @return string A pair of delimited tokens to be used as a
  44.     *  placeholder in the source text surrounding the teletype text.
  45.     *
  46.     */
  47.     
  48.     function process(&$matches)
  49.     {
  50.         $start $this->wiki->addToken(
  51.             $this->rulearray('type' => 'start')
  52.         );
  53.         
  54.         $end $this->wiki->addToken(
  55.             $this->rulearray('type' => 'end')
  56.         );
  57.         
  58.         return $start $matches[1$end;
  59.     }
  60. }
  61. ?>

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