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

Source for file Bold.php

Documentation is available at Bold.php

  1. <?php
  2. // $Id: Bold.php,v 1.1 2004/06/06 15:44:34 pmjones Exp $
  3.  
  4.  
  5. /**
  6. * This class implements a Text_Wiki_Rule to find source text marked for
  7. * strong emphasis (bold) as defined by text surrounded by three
  8. * single-quotes. On parsing, the text itself is left in place, but the
  9. * starting and ending instances of three single-quotes are replaced with
  10. * tokens.
  11. *
  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 and find
  23.     * matches conforming to this rule.  Used by the parse() method.
  24.     * 
  25.     * @access public
  26.     * 
  27.     * @var string 
  28.     * 
  29.     * @see parse()
  30.     * 
  31.     */
  32.     
  33.     var $regex =  "/'''(()|[^'].*)'''/U";
  34.     
  35.     
  36.     /**
  37.     * 
  38.     * Generates a replacement for the matched text.  Token options are:
  39.     * 
  40.     * 'type' => ['start'|'end'] The starting or ending point of the
  41.     * emphasized text.  The text itself is left in the source.
  42.     * 
  43.     * @access public
  44.     *
  45.     * @param array &$matches The array of matches from parse().
  46.     *
  47.     * @return pair of delimited tokens to be used as a placeholder in
  48.     *  the source text surrounding the text to be emphasized.
  49.     *
  50.     */
  51.     
  52.     function process(&$matches)
  53.     {
  54.         $start $this->wiki->addToken($this->rulearray('type' => 'start'));
  55.         $end $this->wiki->addToken($this->rulearray('type' => 'end'));
  56.         return $start $matches[1$end;
  57.     }
  58. }
  59. ?>

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