5 * Parses for blocks of HTML code.
11 * @author Paul M. Jones <pmjones@php.net>
15 * @version $Id: Html.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
21 * Parses for blocks of HTML code.
23 * This class implements a Text_Wiki_Parse 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.
31 * @author Paul M. Jones <pmjones@php.net>
35 class Text_Wiki_Parse_Html
extends Text_Wiki_Parse
{
40 * The regular expression used to parse the source text and find
41 * matches conforming to this rule. Used by the parse() method.
51 var $regex = '/^\<html\>\n(.+)\n\<\/html\>(\s|$)/Umsi';
56 * Generates a replacement for the matched text. Token options are:
58 * 'text' => The text of the HTML to be rendered as-is.
62 * @param array &$matches The array of matches from parse().
64 * @return A delimited token to be used as a placeholder in
65 * the source text, plus any text following the HTML block.
69 function process(&$matches)
71 $options = array('text' => $matches[1]);
72 return $this->wiki
->addToken($this->rule
, $options) . $matches[2];