Source for file Heading.php
Documentation is available at Heading.php
* Parses for heading text.
* 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 equasl signs (=), determining the heading level.
* Equal signs at the end of the line are silently removed.
* 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@php.net>
* @author Tomaiuolo Michele <tomamic@yahoo.it>
* @version $Id: Heading.php 228641 2007-02-01 09:57:36Z mic $
* 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 ]),
'text' => trim($matches[2 ]),
$end = $this->wiki->addToken (
'level' => strlen($matches[1 ])
return $start . trim($matches[2 ]) . $end . "\n\n";
Documentation generated on Mon, 11 Mar 2019 15:40:30 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|