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

Source for file html.php

Documentation is available at html.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | PHP version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2003 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.0 of the PHP license,       |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available through the world-wide-web at                              |
  11. // | http://www.php.net/license/2_02.txt.                                 |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Authors: Paul M. Jones <pmjones@ciaweb.net>                          |
  17. // +----------------------------------------------------------------------+
  18. //
  19. // $Id: html.php,v 1.1 2004/01/04 01:35:23 pmjones Exp $
  20.  
  21.  
  22. /**
  23. * This class implements a Text_Wiki_Rule to find source text marked as
  24. * HTML to be redndred as-is.  The block start is marked by <html> on its
  25. * own line, and the block end is marked by </html> on its own line.
  26. *
  27. @author Paul M. Jones <pmjones@ciaweb.net>
  28. *
  29. @package Text_Wiki
  30. *
  31. */
  32.  
  33.     
  34.     
  35.     /**
  36.     * 
  37.     * The regular expression used to parse the source text and find
  38.     * matches conforming to this rule.  Used by the parse() method.
  39.     * 
  40.     * @access public
  41.     * 
  42.     * @var string 
  43.     * 
  44.     * @see parse()
  45.     * 
  46.     */
  47.     
  48.     var $regex = '/^\<html\>\n(.+)\n\<\/html\>(\s|$)/Umsi';
  49.     
  50.     
  51.     /**
  52.     * 
  53.     * Generates a replacement for the matched text.  Token options are:
  54.     * 
  55.     * 'text' => The text of the HTML to be rendered as-is.
  56.     * 
  57.     * @access public
  58.     *
  59.     * @param array &$matches The array of matches from parse().
  60.     *
  61.     * @return delimited token to be used as a placeholder in
  62.     *  the source text, plus any text following the HTML block.
  63.     *
  64.     */
  65.     
  66.     function process(&$matches)
  67.     {    
  68.         $options = array('text' => $matches[1]);
  69.         return $this->addToken($options$matches[2];
  70.     }
  71.     
  72.     
  73.     /**
  74.     * 
  75.     * Renders a token into text matching the requested format.
  76.     * 
  77.     * @access public
  78.     * 
  79.     * @param array $options The "options" portion of the token (second
  80.     *  element).
  81.     * 
  82.     * @return string The text rendered from the token options.
  83.     * 
  84.     */
  85.     
  86.     function renderXhtml($options)
  87.     {
  88.         return $options['text'];
  89.     }
  90. }
  91. ?>

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