Subversion Repositories Applications.papyrus

Rev

Rev 248 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
248 jpm 1
<?php
2
// $Id: Html.php,v 1.1 2005-01-20 19:43:20 jpm Exp $
3
 
4
 
5
/**
6
*
7
* This class implements a Text_Wiki_Parse to find source text marked as
8
* HTML to be redndred as-is.  The block start is marked by <html> on its
9
* own line, and the block end is marked by </html> on its own line.
10
*
11
* @author Paul M. Jones <pmjones@ciaweb.net>
12
*
13
* @package Text_Wiki
14
*
15
*/
16
 
17
class Text_Wiki_Parse_Html extends Text_Wiki_Parse {
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 = '/^\<html\>\n(.+)\n\<\/html\>(\s|$)/Umsi';
34
 
35
 
36
    /**
37
    *
38
    * Generates a replacement for the matched text.  Token options are:
39
    *
40
    * 'text' => The text of the HTML to be rendered as-is.
41
    *
42
    * @access public
43
    *
44
    * @param array &$matches The array of matches from parse().
45
    *
46
    * @return A delimited token to be used as a placeholder in
47
    * the source text, plus any text following the HTML block.
48
    *
49
    */
50
 
51
    function process(&$matches)
52
    {
53
        $options = array('text' => $matches[1]);
54
        return $this->wiki->addToken($this->rule, $options) . $matches[2];
55
    }
56
}
57
?>