Source for file Heading.php
Documentation is available at Heading.php
// $Id: Heading.php,v 1.4 2004/09/25 19:05:13 pmjones Exp $
* This class implements a Text_Wiki_Parse to find source text marked to
* be a heading element, as defined by text on a line by itself prefixed
* with a number of plus signs (+). The heading text itself is left in
* the source, but is prefixed and suffixed with delimited tokens marking
* the start and end of the heading.
* @author Paul M. Jones <pmjones@ciaweb.net>
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
var $regex = '/^(\+{1,6}) (.*)/m';
* Generates a replacement for the matched text. Token options are:
* 'type' => ['start'|'end'] The starting or ending point of the
* heading text. The text itself is left in the source.
* @param array &$matches The array of matches from parse().
* @return string A pair of delimited tokens to be used as a
* placeholder in the source text surrounding the heading text.
// keep a running count for header IDs. we use this later
// when constructing TOC entries, etc.
$start = $this->wiki->addToken (
'level' => strlen($matches[1 ]),
$end = $this->wiki->addToken (
'level' => strlen($matches[1 ])
return $start . $matches[2 ] . $end . "\n";
Documentation generated on Mon, 11 Mar 2019 13:56:52 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|