Commit 83677290 authored by zYne's avatar zYne

--no commit message

--no commit message
parent 28f361a6
This diff is collapsed.
<?php
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
/**
* Parse structured wiki text and render into arbitrary formats such as XHTML.
*
* PHP versions 4 and 5
*
* @category Text
* @package Text_Wiki
* @author Justin Patrin <justinpatrin@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Default.php,v 1.1 2006/03/01 16:58:17 justinpatrin Exp $
* @link http://pear.php.net/package/Text_Wiki
*/
require_once('Text/Wiki.php');
/**
* This is the parser for the Default ruleset. For now, this simply extends Text_Wiki.
*
* @category Text
* @package Text_Wiki
* @version Release: @package_version@
* @author Justin Patrin <justinpatrin@php.net>
*/
class Text_Wiki_Default extends Text_Wiki {
}
<?php
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
/**
* Parse structured wiki text and render into arbitrary formats such as XHTML.
* This is the Text_Wiki extension for Mediawiki markup
*
* PHP versions 4 and 5
*
* @category Text
* @package Text_Wiki
* @author Bertrand Gugger <bertrand@toggg.com>
* @author Paul M. Jones <pmjones@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Mediawiki.php,v 1.8 2006/02/25 09:59:34 toggg Exp $
* @link http://pear.php.net/package/Text_Wiki
*/
/**
* "master" class for handling the management and convenience
*/
require_once('Text/Wiki.php');
/**
* Base Text_Wiki handler class extension for Mediawiki markup
*
* @category Text
* @package Text_Wiki
* @author Bertrand Gugger <bertrand@toggg.com>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version Release: @package_version@
* @link http://pear.php.net/package/Text_Wiki
* @see Text_Wiki::Text_Wiki()
*/
class Text_Wiki_Mediawiki extends Text_Wiki {
var $rules = array(
'Prefilter',
'Delimiter',
// 'Code',
// 'Plugin',
// 'Function',
// 'Html',
'Raw',
// 'Preformatted',
// 'Include',
// 'Embed',
// 'Page',
// 'Anchor',
'Heading',
'Toc',
// 'Titlebar',
'Horiz',
'Break',
// 'Blockquote',
'List',
'Deflist',
'Table',
// 'Box',
// 'Image', // done by Wikilink but still possible to disable/configure
// 'Phplookup',
// 'Center',
'Newline',
'Paragraph',
'Url',
// 'Freelink',
// 'Colortext',
'Wikilink',
// 'Strong', ** will be only fake inserted by Emphasis if needed for render
// 'Bold',
'Emphasis',
// 'Italic',
// 'Underline',
// 'Tt',
// 'Superscript',
// 'Subscript',
// 'Specialchar',
// 'Revise',
// 'Interwiki', // done by Wikilink but still possible to disable/configure
'Tighten'
);
/**
* Constructor: just adds the path to Mediawiki rules
*
* @access public
* @param array $rules The set of rules to load for this object.
*/
function Text_Wiki_Mediawiki($rules = null) {
parent::Text_Wiki($rules);
$this->addPath('parse', $this->fixPath(dirname(__FILE__)).'Parse/Mediawiki');
}
}
?>
<?php
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
/**
* Baseline rule class for extension into a "real" parser component.
*
* PHP versions 4 and 5
*
* @category Text
* @package Text_Wiki
* @author Paul M. Jones <pmjones@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Parse.php,v 1.5 2005/07/29 08:57:29 toggg Exp $
* @link http://pear.php.net/package/Text_Wiki
*/
/**
* Baseline rule class for extension into a "real" parser component.
*
* Text_Wiki_Rule classes do not stand on their own; they are called by a
* Text_Wiki object, typcially in the transform() method. Each rule class
* performs three main activities: parse, process, and render.
*
* The parse() method takes a regex and applies it to the whole block of
* source text at one time. Each match is sent as $matches to the
* process() method.
*
* The process() method acts on the matched text from the source, and
* then processes the source text is some way. This may mean the
* creation of a delimited token using addToken(). In every case, the
* process() method returns the text that should replace the matched text
* from parse().
*
* @category Text
* @package Text_Wiki
* @author Paul M. Jones <pmjones@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version Release: @package_version@
* @link http://pear.php.net/package/Text_Wiki
*/
class Text_Wiki_Parse {
/**
*
* Configuration options for this parser rule.
*
* @access public
*
* @var string
*
*/
var $conf = array();
/**
*
* Regular expression to find matching text for this rule.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = null;
/**
*
* The name of this rule for new token array elements.
*
* @access public
*
* @var string
*
*/
var $rule = null;
/**
*
* A reference to the calling Text_Wiki object.
*
* This is needed so that each rule has access to the same source
* text, token set, URLs, interwiki maps, page names, etc.
*
* @access public
*
* @var object
*/
var $wiki = null;
/**
*
* Constructor for this parser rule.
*
* @access public
*
* @param object &$obj The calling "parent" Text_Wiki object.
*
*/
function Text_Wiki_Parse(&$obj)
{
// set the reference to the calling Text_Wiki object;
// this allows us access to the shared source text, token
// array, etc.
$this->wiki =& $obj;
// set the name of this rule; generally used when adding
// to the tokens array. strip off the Text_Wiki_Parse_ portion.
// text_wiki_parse_
// 0123456789012345
$tmp = substr(get_class($this), 16);
$this->rule = ucwords(strtolower($tmp));
// override config options for the rule if specified
if (isset($this->wiki->parseConf[$this->rule]) &&
is_array($this->wiki->parseConf[$this->rule])) {
$this->conf = array_merge(
$this->conf,
$this->wiki->parseConf[$this->rule]
);
}
}
/**
*
* Abstrct method to parse source text for matches.
*
* Applies the rule's regular expression to the source text, passes
* every match to the process() method, and replaces the matched text
* with the results of the processing.
*
* @access public
*
* @see Text_Wiki_Parse::process()
*
*/
function parse()
{
$this->wiki->source = preg_replace_callback(
$this->regex,
array(&$this, 'process'),
$this->wiki->source
);
}
/**
*
* Abstract method to generate replacements for matched text.
*
* @access public
*
* @param array $matches An array of matches from the parse() method
* as generated by preg_replace_callback. $matches[0] is the full
* matched string, $matches[1] is the first matched pattern,
* $matches[2] is the second matched pattern, and so on.
*
* @return string The processed text replacement; defaults to the
* full matched string (i.e., no changes to the text).
*
* @see Text_Wiki_Parse::parse()
*
*/
function process(&$matches)
{
return $matches[0];
}
/**
*
* Simple method to safely get configuration key values.
*
* @access public
*
* @param string $key The configuration key.
*
* @param mixed $default If the key does not exist, return this value
* instead.
*
* @return mixed The configuration key value (if it exists) or the
* default value (if not).
*
*/
function getConf($key, $default = null)
{
if (isset($this->conf[$key])) {
return $this->conf[$key];
} else {
return $default;
}
}
/**
*
* Extract 'attribute="value"' portions of wiki markup.
*
* This kind of markup is typically used only in macros, but is useful
* anywhere.
*
* The syntax is pretty strict; there can be no spaces between the
* option name, the equals, and the first double-quote; the value
* must be surrounded by double-quotes. You can escape characters in
* the value with a backslash, and the backslash will be stripped for
* you.
*
* @access public
*
* @param string $text The "attributes" portion of markup.
*
* @return array An associative array of key-value pairs where the
* key is the option name and the value is the option value.
*
*/
function getAttrs($text)
{
// find the =" sections;
$tmp = explode('="', trim($text));
// basic setup
$k = count($tmp) - 1;
$attrs = array();
$key = null;
// loop through the sections
foreach ($tmp as $i => $val) {
// first element is always the first key
if ($i == 0) {
$key = trim($val);
continue;
}
// find the last double-quote in the value.
// the part to the left is the value for the last key,
// the part to the right is the next key name
$pos = strrpos($val, '"');
$attrs[$key] = stripslashes(substr($val, 0, $pos));
$key = trim(substr($val, $pos+1));
}
return $attrs;
}
}
?>
<?php
/**
*
* Parses for anchor targets.
*
* @category Text
*
* @package Text_Wiki
*
* @author Manuel Holtgrewe <purestorm at ggnore dot net>
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Anchor.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* This class implements a Text_Wiki_Parse to add an anchor target name
* in the wiki page.
*
* @author Manuel Holtgrewe <purestorm at ggnore dot net>
*
* @author Paul M. Jones <pmjones at ciaweb dot net>
*
* @category Text
*
* @package Text_Wiki
*
*/
class Text_Wiki_Parse_Anchor extends Text_Wiki_Parse {
/**
*
* The regular expression used to find source text matching this
* rule. Looks like a macro: [[# anchor_name]]
*
* @access public
*
* @var string
*
*/
var $regex = '/(\[\[# )([-_A-Za-z0-9.]+?)( .+)?(\]\])/i';
/**
*
* Generates a token entry for the matched text. Token options are:
*
* 'text' => The full matched text, not including the <code></code> tags.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token number to be used as a placeholder in
* the source text.
*
*/
function process(&$matches) {
$name = $matches[2];
$text = $matches[3];
$start = $this->wiki->addToken(
$this->rule,
array('type' => 'start', 'name' => $name)
);
$end = $this->wiki->addToken(
$this->rule,
array('type' => 'end', 'name' => $name)
);
// done, place the script output directly in the source
return $start . trim($text) . $end;
}
}
?>
<?php
/**
*
* Parse for block-quoted text.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Blockquote.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parse for block-quoted text.
*
* Find source text marked as a blockquote, identified by any number of
* greater-than signs '>' at the start of the line, followed by a space,
* and then the quote text; each '>' indicates an additional level of
* quoting.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Blockquote extends Text_Wiki_Parse {
/**
*
* Regex for parsing the source text.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/\n((\>).*\n)(?!(\>))/Us';
/**
*
* Generates a replacement for the matched text.
*
* Token options are:
*
* 'type' =>
* 'start' : the start of a blockquote
* 'end' : the end of a blockquote
*
* 'level' => the indent level (0 for the first level, 1 for the
* second, etc)
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A series of text and delimited tokens marking the different
* list text and list elements.
*
*/
function process(&$matches)
{
// the replacement text we will return to parse()
$return = '';
// the list of post-processing matches
$list = array();
// $matches[1] is the text matched as a list set by parse();
// create an array called $list that contains a new set of
// matches for the various list-item elements.
preg_match_all(
'=^(\>+) (.*\n)=Ums',
$matches[1],
$list,
PREG_SET_ORDER
);
// a stack of starts and ends; we keep this so that we know what
// indent level we're at.
$stack = array();
// loop through each list-item element.
foreach ($list as $key => $val) {
// $val[0] is the full matched list-item line
// $val[1] is the number of initial '>' chars (indent level)
// $val[2] is the quote text
// we number levels starting at 1, not zero
$level = strlen($val[1]);
// get the text of the line
$text = $val[2];
// add a level to the list?
while ($level > count($stack)) {
// the current indent level is greater than the number
// of stack elements, so we must be starting a new
// level. push the new level onto the stack with a
// dummy value (boolean true)...
array_push($stack, true);
$return .= "\n";
// ...and add a start token to the return.
$return .= $this->wiki->addToken(
$this->rule,
array(
'type' => 'start',
'level' => $level - 1
)
);
$return .= "\n\n";
}
// remove a level?
while (count($stack) > $level) {
// as long as the stack count is greater than the
// current indent level, we need to end list types.
// continue adding end-list tokens until the stack count
// and the indent level are the same.
array_pop($stack);
$return .= "\n\n";
$return .= $this->wiki->addToken(
$this->rule,
array (
'type' => 'end',
'level' => count($stack)
)
);
$return .= "\n";
}
// add the line text.
$return .= $text;
}
// the last line may have been indented. go through the stack
// and create end-tokens until the stack is empty.
$return .= "\n";
while (count($stack) > 0) {
array_pop($stack);
$return .= $this->wiki->addToken(
$this->rule,
array (
'type' => 'end',
'level' => count($stack)
)
);
}
// we're done! send back the replacement text.
return "\n$return\n\n";
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for bold text.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Bold.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for bold text.
*
* This class implements a Text_Wiki_Rule to find source text marked for
* strong emphasis (bold) as defined by text surrounded by three
* single-quotes. On parsing, the text itself is left in place, but the
* starting and ending instances of three single-quotes are replaced with
* tokens.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Bold extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/'''(()|[^'].*)'''/U";
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* emphasized text. The text itself is left in the source.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A pair of delimited tokens to be used as a placeholder in
* the source text surrounding the text to be emphasized.
*
*/
function process(&$matches)
{
$start = $this->wiki->addToken($this->rule, array('type' => 'start'));
$end = $this->wiki->addToken($this->rule, array('type' => 'end'));
return $start . $matches[1] . $end;
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for explicit line breaks.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Break.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for explicit line breaks.
*
* This class implements a Text_Wiki_Parse to mark forced line breaks in the
* source text.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Break extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/ _\n/';
/**
*
* Generates a replacement token for the matched text.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return string A delimited token to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
return $this->wiki->addToken($this->rule);
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for centered lines of text.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Center.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for centered lines of text.
*
* This class implements a Text_Wiki_Parse to find lines marked for centering.
* The line must start with "= " (i.e., an equal-sign followed by a space).
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Center extends Text_Wiki_Parse {
/**
*
* The regular expression used to find source text matching this
* rule.
*
* @access public
*
* @var string
*
*/
var $regex = '/\n\= (.*?)\n/';
/**
*
* Generates a token entry for the matched text.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token number to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
$start = $this->wiki->addToken(
$this->rule,
array('type' => 'start')
);
$end = $this->wiki->addToken(
$this->rule,
array('type' => 'end')
);
return "\n" . $start . $matches[1] . $end . "\n";
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for text marked as a code example block.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Code.php,v 1.10 2006/02/21 14:33:53 toggg Exp $
*
*/
/**
*
* Parses for text marked as a code example block.
*
* This class implements a Text_Wiki_Parse to find sections marked as code
* examples. Blocks are marked as the string <code> on a line by itself,
* followed by the inline code example, and terminated with the string
* </code> on a line by itself. The code example is run through the
* native PHP highlight_string() function to colorize it, then surrounded
* with <pre>...</pre> tags when rendered as XHTML.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Code extends Text_Wiki_Parse {
/**
*
* The regular expression used to find source text matching this
* rule.
*
* @access public
*
* @var string
*
*/
/* var $regex = '/^(\<code( .+)?\>)\n(.+)\n(\<\/code\>)(\s|$)/Umsi';*/
var $regex = ';^<code(\s[^>]*)?>((?:(?R)|.)*?)\n</code>(\s|$);msi';
/**
*
* Generates a token entry for the matched text. Token options are:
*
* 'text' => The full matched text, not including the <code></code> tags.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token number to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
// are there additional attribute arguments?
$args = trim($matches[1]);
if ($args == '') {
$options = array(
'text' => $matches[2],
'attr' => array('type' => '')
);
} else {
// get the attributes...
$attr = $this->getAttrs($args);
// ... and make sure we have a 'type'
if (! isset($attr['type'])) {
$attr['type'] = '';
}
// retain the options
$options = array(
'text' => $matches[2],
'attr' => $attr
);
}
return $this->wiki->addToken($this->rule, $options) . $matches[3];
}
}
?>
<?php
/**
*
* Parses for colorized text.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Colortext.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for colorized text.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Colortext extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/\#\#(.+?)\|(.+?)\#\#/";
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* emphasized text. The text itself is left in the source.
*
* 'color' => the color indicator
*
* @access public
*
* @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 text to be
* emphasized.
*
*/
function process(&$matches)
{
$start = $this->wiki->addToken(
$this->rule,
array(
'type' => 'start',
'color' => $matches[1]
)
);
$end = $this->wiki->addToken(
$this->rule,
array(
'type' => 'end',
'color' => $matches[1]
)
);
return $start . $matches[2] . $end;
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for definition lists.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Deflist.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for definition lists.
*
* This class implements a Text_Wiki_Parse to find source text marked as a
* definition list. In short, if a line starts with ':' then it is a
* definition list item; another ':' on the same line indicates the end
* of the definition term and the beginning of the definition narrative.
* The list items must be on sequential lines (no blank lines between
* them) -- a blank line indicates the beginning of a new list.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Deflist extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/\n((: ).*\n)(?!(: |\n))/Us';
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' =>
* 'list_start' : the start of a definition list
* 'list_end' : the end of a definition list
* 'term_start' : the start of a definition term
* 'term_end' : the end of a definition term
* 'narr_start' : the start of definition narrative
* 'narr_end' : the end of definition narrative
* 'unknown' : unknown type of definition portion
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A series of text and delimited tokens marking the different
* list text and list elements.
*
*/
function process(&$matches)
{
// the replacement text we will return to parse()
$return = '';
// the list of post-processing matches
$list = array();
// start the deflist
$options = array('type' => 'list_start');
$return .= $this->wiki->addToken($this->rule, $options);
// $matches[1] is the text matched as a list set by parse();
// create an array called $list that contains a new set of
// matches for the various definition-list elements.
preg_match_all(
'/^(: )(.*)?( : )(.*)?$/Ums',
$matches[1],
$list,
PREG_SET_ORDER
);
// add each term and narrative
foreach ($list as $key => $val) {
$return .= (
$this->wiki->addToken($this->rule, array('type' => 'term_start')) .
trim($val[2]) .
$this->wiki->addToken($this->rule, array('type' => 'term_end')) .
$this->wiki->addToken($this->rule, array('type' => 'narr_start')) .
trim($val[4]) .
$this->wiki->addToken($this->rule, array('type' => 'narr_end'))
);
}
// end the deflist
$options = array('type' => 'list_end');
$return .= $this->wiki->addToken($this->rule, $options);
// done!
return "\n" . $return . "\n\n";
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for Text_Wiki delimiter characters already in the source text.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Delimiter.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for Text_Wiki delimiter characters already in the source text.
*
* This class implements a Text_Wiki_Parse to find instances of the delimiter
* character already embedded in the source text; it extracts them and replaces
* them with a delimited token, then renders them as the delimiter itself
* when the target format is XHTML.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Delimiter extends Text_Wiki_Parse {
/**
*
* Constructor. Overrides the Text_Wiki_Parse constructor so that we
* can set the $regex property dynamically (we need to include the
* Text_Wiki $delim character.
*
* @param object &$obj The calling "parent" Text_Wiki object.
*
* @param string $name The token name to use for this rule.
*
*/
function Text_Wiki_Parse_delimiter(&$obj)
{
parent::Text_Wiki_Parse($obj);
$this->regex = '/' . $this->wiki->delim . '/';
}
/**
*
* Generates a token entry for the matched text. Token options are:
*
* 'text' => The full matched text.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token number to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
return $this->wiki->addToken(
$this->rule,
array('text' => $this->wiki->delim)
);
}
}
?>
\ No newline at end of file
<?php
/**
*
* Embeds the results of a PHP script at render-time.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Embed.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Embeds the results of a PHP script at render-time.
*
* This class implements a Text_Wiki_Parse to embed the contents of a URL
* inside the page at render-time. Typically used to get script output.
* This differs from the 'include' rule, which incorporates results at
* parse-time; 'embed' output does not get parsed by Text_Wiki, while
* 'include' ouput does.
*
* This rule is inherently not secure; it allows cross-site scripting to
* occur if the embedded output has <script> or other similar tags. Be
* careful.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Embed extends Text_Wiki_Parse {
var $conf = array(
'base' => '/path/to/scripts/'
);
var $file = null;
var $output = null;
var $vars = null;
/**
*
* The regular expression used to find source text matching this
* rule.
*
* @access public
*
* @var string
*
*/
var $regex = '/(\[\[embed )(.+?)( .+?)?(\]\])/i';
/**
*
* Generates a token entry for the matched text. Token options are:
*
* 'text' => The full matched text, not including the <code></code> tags.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token number to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
// save the file location
$this->file = $this->getConf('base', './') . $matches[2];
// extract attribs as variables in the local space
$this->vars = $this->getAttrs($matches[3]);
unset($this->vars['this']);
extract($this->vars);
// run the script
ob_start();
include($this->file);
$this->output = ob_get_contents();
ob_end_clean();
// done, place the script output directly in the source
return $this->wiki->addToken(
$this->rule,
array('text' => $this->output)
);
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for emphasized text.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Emphasis.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for emphasized text.
*
* This class implements a Text_Wiki_Parse to find source text marked for
* emphasis (italics) as defined by text surrounded by two single-quotes.
* On parsing, the text itself is left in place, but the starting and ending
* instances of two single-quotes are replaced with tokens.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_emphasis extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/\/\/(.*?)\/\//";
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* emphasized text. The text itself is left in the source.
*
* @access public
*
* @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 text to be
* emphasized.
*
*/
function process(&$matches)
{
$start = $this->wiki->addToken(
$this->rule, array('type' => 'start')
);
$end = $this->wiki->addToken(
$this->rule, array('type' => 'end')
);
return $start . $matches[1] . $end;
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for wiki freelink text.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Freelink.php,v 1.4 2005/10/19 23:43:53 toggg Exp $
*
*/
/**
*
* Parses for freelinked page links.
*
* This class implements a Text_Wiki_Parse to find source text marked as a
* wiki freelink, and automatically create a link to that page.
*
* A freelink is any page name not conforming to the standard
* StudlyCapsStyle for a wiki page name. For example, a page normally
* named MyHomePage can be renamed and referred to as ((My Home Page)) --
* note the spaces in the page name. You can also make a "nice-looking"
* link without renaming the target page; e.g., ((MyHomePage|My Home
* Page)). Finally, you can use named anchors on the target page:
* ((MyHomePage|My Home Page#Section1)).
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Freelink extends Text_Wiki_Parse {
/**
*
* Constructor. We override the Text_Wiki_Parse constructor so we can
* explicitly comment each part of the $regex property.
*
* @access public
*
* @param object &$obj The calling "parent" Text_Wiki object.
*
*/
function Text_Wiki_Parse_Freelink(&$obj)
{
parent::Text_Wiki_Parse($obj);
$this->regex =
'/' . // START regex
"\\(\\(" . // double open-parens
"(" . // START freelink page patter
"[-A-Za-z0-9 _+\\/.,;:!?'\"\\[\\]\\{\\}&\xc0-\xff]+" . // 1 or more of just about any character
")" . // END freelink page pattern
"(" . // START display-name
"\|" . // a pipe to start the display name
"[-A-Za-z0-9 _+\\/.,;:!?'\"\\[\\]\\{\\}&\xc0-\xff]+" . // 1 or more of just about any character
")?" . // END display-name pattern 0 or 1
"(" . // START pattern for named anchors
"\#" . // a hash mark
"[A-Za-z]" . // 1 alpha
"[-A-Za-z0-9_:.]*" . // 0 or more alpha, digit, underscore
")?" . // END named anchors pattern 0 or 1
"()\\)\\)" . // double close-parens
'/'; // END regex
}
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'page' => the wiki page name (e.g., HomePage).
*
* 'text' => alternative text to be displayed in place of the wiki
* page name.
*
* 'anchor' => a named anchor on the target wiki page
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token to be used as a placeholder in
* the source text, plus any text priot to the match.
*
*/
function process(&$matches)
{
// use nice variable names
$page = $matches[1];
$text = $matches[2];
$anchor = $matches[3];
// is the page given a new text appearance?
if (trim($text) == '') {
// no
$text = $page;
} else {
// yes, strip the leading | character
$text = substr($text, 1);
}
// set the options
$options = array(
'page' => $page,
'text' => $text,
'anchor' => $anchor
);
// return a token placeholder
return $this->wiki->addToken($this->rule, $options);
}
}
?>
<?php
/**
*
* Parses for an API function documentation block.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Function.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for an API function documentation block.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Function extends Text_Wiki_Parse {
var $regex = '/^(\<function\>)\n(.+)\n(\<\/function\>)(\s|$)/Umsi';
function process(&$matches)
{
// default options
$opts = array(
'name' => null,
'access' => null,
'return' => null,
'params' => array(),
'throws' => array()
);
// split apart the markup lines and loop through them
$lines = explode("\n", $matches[2]);
foreach ($lines as $line) {
// skip blank lines
if (trim($line) == '') {
continue;
}
// find the first ':' on the line; the left part is the
// type, the right part is the value. skip lines without
// a ':' on them.
$pos = strpos($line, ':');
if ($pos === false) {
continue;
}
// $type is the line type: name, access, return, param, throws
// 012345678901234
// name: something
$type = trim(substr($line, 0, $pos));
$val = trim(substr($line, $pos+1));
switch($type) {
case 'a':
case 'access':
$opts['access'] = $val;
break;
case 'n':
case 'name':
$opts['name'] = $val;
break;
case 'p':
case 'param':
$tmp = explode(',', $val);
$k = count($tmp);
if ($k == 1) {
$opts['params'][] = array(
'type' => $tmp[0],
'descr' => null,
'default' => null
);
} elseif ($k == 2) {
$opts['params'][] = array(
'type' => $tmp[0],
'descr' => $tmp[1],
'default' => null
);
} else {
$opts['params'][] = array(
'type' => $tmp[0],
'descr' => $tmp[1],
'default' => $tmp[2]
);
}
break;
case 'r':
case 'return':
case 'returns':
$opts['return'] = $val;
break;
case 't':
case 'throws':
$tmp = explode(',', $val);
$k = count($tmp);
if ($k == 1) {
$opts['throws'][] = array(
'type' => $tmp[0],
'descr' => null
);
} else {
$opts['throws'][] = array(
'type' => $tmp[0],
'descr' => $tmp[1]
);
}
break;
default:
$opts[$type] = $val;
break;
}
}
// add the token back in place
return $this->wiki->addToken($this->rule, $opts) . $matches[4];
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for heading text.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Heading.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* 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 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.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Heading extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/^(\+{1,6}) (.*)/m';
var $conf = array(
'id_prefix' => 'toc'
);
/**
*
* 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.
*
* @access public
*
* @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.
*
*/
function process(&$matches)
{
// keep a running count for header IDs. we use this later
// when constructing TOC entries, etc.
static $id;
if (! isset($id)) {
$id = 0;
}
$prefix = htmlspecialchars($this->getConf('id_prefix'));
$start = $this->wiki->addToken(
$this->rule,
array(
'type' => 'start',
'level' => strlen($matches[1]),
'text' => $matches[2],
'id' => $prefix . $id ++
)
);
$end = $this->wiki->addToken(
$this->rule,
array(
'type' => 'end',
'level' => strlen($matches[1])
)
);
return $start . $matches[2] . $end . "\n";
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for horizontal ruling lines.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Horiz.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for horizontal ruling lines.
*
* This class implements a Text_Wiki_Parse to find source text marked to
* be a horizontal rule, as defined by four dashed on their own line.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Horiz extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/^([-]{4,})$/m';
/**
*
* Generates a replacement token for the matched text.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return string A token marking the horizontal rule.
*
*/
function process(&$matches)
{
return $this->wiki->addToken($this->rule);
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for blocks of HTML code.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Html.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for blocks of HTML code.
*
* This class implements a Text_Wiki_Parse to find source text marked as
* HTML to be redndred as-is. The block start is marked by <html> on its
* own line, and the block end is marked by </html> on its own line.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Html extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/^\<html\>\n(.+)\n\<\/html\>(\s|$)/Umsi';
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'text' => The text of the HTML to be rendered as-is.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token to be used as a placeholder in
* the source text, plus any text following the HTML block.
*
*/
function process(&$matches)
{
$options = array('text' => $matches[1]);
return $this->wiki->addToken($this->rule, $options) . $matches[2];
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for image placement.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Image.php,v 1.5 2005/09/12 11:34:44 toggg Exp $
*
*/
/**
*
* Parses for image placement.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Image extends Text_Wiki_Parse {
/**
* URL schemes recognized by this rule.
*
* @access public
* @var array
*/
var $conf = array(
'schemes' => 'http|https|ftp|gopher|news',
'host_regexp' => '(?:[^.\s/"\'<\\\#delim#\ca-\cz]+\.)*[a-z](?:[-a-z0-9]*[a-z0-9])?\.?',
'path_regexp' => '(?:/[^\s"<\\\#delim#\ca-\cz]*)?'
);
/**
*
* The regular expression used to find source text matching this
* rule.
*
* @access public
*
* @var string
*
*/
var $regex = '/(\[\[image\s+)(.+?)(\]\])/i';
/**
* The regular expressions used to check ecternal urls
*
* @access public
* @var string
* @see parse()
*/
var $url = '';
/**
* Constructor.
* We override the constructor to build up the url regex from config
*
* @param object &$obj the base conversion handler
* @return The parser object
* @access public
*/
function Text_Wiki_Parse_Image(&$obj)
{
$default = $this->conf;
parent::Text_Wiki_Parse($obj);
// convert the list of recognized schemes to a regex OR,
$schemes = $this->getConf('schemes', $default['schemes']);
$this->url = str_replace( '#delim#', $this->wiki->delim,
'#(?:' . (is_array($schemes) ? implode('|', $schemes) : $schemes) . ')://'
. $this->getConf('host_regexp', $default['host_regexp'])
. $this->getConf('path_regexp', $default['path_regexp']) .'#');
}
/**
*
* Generates a token entry for the matched text. Token options are:
*
* 'src' => The image source, typically a relative path name.
*
* 'opts' => Any macro options following the source.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token number to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
$pos = strpos($matches[2], ' ');
if ($pos === false) {
$options = array(
'src' => $matches[2],
'attr' => array());
} else {
// everything after the space is attribute arguments
$options = array(
'src' => substr($matches[2], 0, $pos),
'attr' => $this->getAttrs(substr($matches[2], $pos+1))
);
// check the scheme case of external link
if (array_key_exists('link', $options['attr'])) {
// external url ?
if (($pos = strpos($options['attr']['link'], '://')) !== false) {
if (!preg_match($this->url, $options['attr']['link'])) {
return $matches[0];
}
} elseif (in_array('Wikilink', $this->wiki->disable)) {
return $matches[0]; // Wikilink disabled
}
}
}
return $this->wiki->addToken($this->rule, $options);
}
}
?>
<?php
/**
*
* Includes the contents of another PHP script into the source text.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Include.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* This class implements a Text_Wiki_Parse to include the results of a
* script directly into the source at parse-time; thus, the output of the
* script will be parsed by Text_Wiki. This differs from the 'embed'
* rule, which incorporates the results at render-time, meaning that the
* 'embed' content is not parsed by Text_Wiki.
*
* DANGER!
*
* This rule is inherently not secure; it allows cross-site scripting to
* occur if the embedded output has <script> or other similar tags. Be
* careful.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Include extends Text_Wiki_Parse {
var $conf = array(
'base' => '/path/to/scripts/'
);
var $file = null;
var $output = null;
var $vars = null;
/**
*
* The regular expression used to find source text matching this
* rule.
*
* @access public
*
* @var string
*
*/
var $regex = '/(\[\[include )(.+?)( .+?)?(\]\])/i';
/**
*
* Includes the results of the script directly into the source; the output
* will subsequently be parsed by the remaining Text_Wiki rules.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return The results of the included script.
*
*/
function process(&$matches)
{
// save the file location
$this->file = $this->getConf('base', './') . $matches[2];
// extract attribs as variables in the local space
$this->vars = $this->getAttrs($matches[3]);
unset($this->vars['this']);
extract($this->vars);
// run the script
ob_start();
include($this->file);
$this->output = ob_get_contents();
ob_end_clean();
// done, place the script output directly in the source
return $this->output;
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for interwiki links.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Interwiki.php,v 1.4 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for interwiki links.
*
* This class implements a Text_Wiki_Parse to find source text marked as
* an Interwiki link. See the regex for a detailed explanation of the
* text matching procedure; e.g., "InterWikiName:PageName".
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Interwiki extends Text_Wiki_Parse {
// double-colons wont trip up now
var $regex = '([A-Za-z0-9_]+):((?!:)[A-Za-z0-9_\/=&~#.:;-]+)';
/**
*
* Parser. We override the standard parser so we can
* find both described interwiki links and standalone links.
*
* @access public
*
* @return void
*
*/
function parse()
{
// described interwiki links
$tmp_regex = '/\[' . $this->regex . ' (.+?)\]/';
$this->wiki->source = preg_replace_callback(
$tmp_regex,
array(&$this, 'processDescr'),
$this->wiki->source
);
// standalone interwiki links
$tmp_regex = '/' . $this->regex . '/';
$this->wiki->source = preg_replace_callback(
$tmp_regex,
array(&$this, 'process'),
$this->wiki->source
);
}
/**
*
* Generates a replacement for the matched standalone interwiki text.
* Token options are:
*
* 'site' => The key name for the Text_Wiki interwiki array map,
* usually the name of the interwiki site.
*
* 'page' => The page on the target interwiki to link to.
*
* 'text' => The text to display as the link.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token to be used as a placeholder in
* the source text, plus any text priot to the match.
*
*/
function process(&$matches)
{
$options = array(
'site' => $matches[1],
'page' => $matches[2],
'text' => $matches[0]
);
return $this->wiki->addToken($this->rule, $options);
}
/**
*
* Generates a replacement for described interwiki links. Token
* options are:
*
* 'site' => The key name for the Text_Wiki interwiki array map,
* usually the name of the interwiki site.
*
* 'page' => The page on the target interwiki to link to.
*
* 'text' => The text to display as the link.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token to be used as a placeholder in
* the source text, plus any text priot to the match.
*
*/
function processDescr(&$matches)
{
$options = array(
'site' => $matches[1],
'page' => $matches[2],
'text' => $matches[3]
);
return $this->wiki->addToken($this->rule, $options);
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for italic text.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Italic.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for italic text.
*
* This class implements a Text_Wiki_Parse to find source text marked for
* emphasis (italics) as defined by text surrounded by two single-quotes.
* On parsing, the text itself is left in place, but the starting and ending
* instances of two single-quotes are replaced with tokens.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Italic extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/''(()|[^'].*)''/U";
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* emphasized text. The text itself is left in the source.
*
* @access public
*
* @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 text to be
* emphasized.
*
*/
function process(&$matches)
{
$start = $this->wiki->addToken(
$this->rule, array('type' => 'start')
);
$end = $this->wiki->addToken(
$this->rule, array('type' => 'end')
);
return $start . $matches[1] . $end;
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for bulleted and numbered lists.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: List.php,v 1.7 2005/11/06 20:44:09 toggg Exp $
*
*/
/**
*
* Parses for bulleted and numbered lists.
*
* This class implements a Text_Wiki_Parse to find source text marked as
* a bulleted or numbered list. In short, if a line starts with '* ' then
* it is a bullet list item; if a line starts with '# ' then it is a
* number list item. Spaces in front of the * or # indicate an indented
* sub-list. The list items must be on sequential lines, and may be
* separated by blank lines to improve readability. Using a non-* non-#
* non-whitespace character at the beginning of a line ends the list.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_List extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/^((\*|#) .*\n)(?!\2 |(?: {1,}((?:\*|#) |\n)))/Usm';
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' =>
* 'bullet_start' : the start of a bullet list
* 'bullet_end' : the end of a bullet list
* 'number_start' : the start of a number list
* 'number_end' : the end of a number list
* 'item_start' : the start of item text (bullet or number)
* 'item_end' : the end of item text (bullet or number)
* 'unknown' : unknown type of list or item
*
* 'level' => the indent level (0 for the first level, 1 for the
* second, etc)
*
* 'count' => the list item number at this level. not needed for
* xhtml, but very useful for PDF and RTF.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A series of text and delimited tokens marking the different
* list text and list elements.
*
*/
function process(&$matches)
{
// the replacement text we will return
$return = '';
// the list of post-processing matches
$list = array();
// a stack of list-start and list-end types; we keep this
// so that we know what kind of list we're working with
// (bullet or number) and what indent level we're at.
$stack = array();
// the item count is the number of list items for any
// given list-type on the stack
$itemcount = array();
// have we processed the very first list item?
$pastFirst = false;
// populate $list with this set of matches. $matches[1] is the
// text matched as a list set by parse().
preg_match_all(
'=^( {0,})(\*|#) (.*)$=Ums',
$matches[1],
$list,
PREG_SET_ORDER
);
// loop through each list-item element.
foreach ($list as $key => $val) {
// $val[0] is the full matched list-item line
// $val[1] is the number of initial spaces (indent level)
// $val[2] is the list item type (* or #)
// $val[3] is the list item text
// how many levels are we indented? (1 means the "root"
// list level, no indenting.)
$level = strlen($val[1]) + 1;
// get the list item type
if ($val[2] == '*') {
$type = 'bullet';
} elseif ($val[2] == '#') {
$type = 'number';
} else {
$type = 'unknown';
}
// get the text of the list item
$text = $val[3];
// add a level to the list?
if ($level > count($stack)) {
// the current indent level is greater than the
// number of stack elements, so we must be starting
// a new list. push the new list type onto the
// stack...
array_push($stack, $type);
// ...and add a list-start token to the return.
$return .= $this->wiki->addToken(
$this->rule,
array(
'type' => $type . '_list_start',
'level' => $level - 1
)
);
}
// remove a level from the list?
while (count($stack) > $level) {
// so we don't keep counting the stack, we set up a temp
// var for the count. -1 becuase we're going to pop the
// stack in the next command. $tmp will then equal the
// current level of indent.
$tmp = count($stack) - 1;
// as long as the stack count is greater than the
// current indent level, we need to end list types.
// continue adding end-list tokens until the stack count
// and the indent level are the same.
$return .= $this->wiki->addToken(
$this->rule,
array (
'type' => array_pop($stack) . '_list_end',
'level' => $tmp
)
);
// reset to the current (previous) list type so that
// the new list item matches the proper list type.
$type = $stack[$tmp - 1];
// reset the item count for the popped indent level
unset($itemcount[$tmp + 1]);
}
// add to the item count for this list (taking into account
// which level we are at).
if (! isset($itemcount[$level])) {
// first count
$itemcount[$level] = 0;
} else {
// increment count
$itemcount[$level]++;
}
// is this the very first item in the list?
if (! $pastFirst) {
$first = true;
$pastFirst = true;
} else {
$first = false;
}
// create a list-item starting token.
$start = $this->wiki->addToken(
$this->rule,
array(
'type' => $type . '_item_start',
'level' => $level,
'count' => $itemcount[$level],
'first' => $first
)
);
// create a list-item ending token.
$end = $this->wiki->addToken(
$this->rule,
array(
'type' => $type . '_item_end',
'level' => $level,
'count' => $itemcount[$level]
)
);
// add the starting token, list-item text, and ending token
// to the return.
$return .= $start . $val[3] . $end;
}
// the last list-item may have been indented. go through the
// list-type stack and create end-list tokens until the stack
// is empty.
while (count($stack) > 0) {
$return .= $this->wiki->addToken(
$this->rule,
array (
'type' => array_pop($stack) . '_list_end',
'level' => count($stack)
)
);
}
// we're done! send back the replacement text.
return "\n\n" . $return . "\n\n";
}
}
?>
<?php
/**
*
* Parses for implied line breaks indicated by newlines.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Newline.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for implied line breaks indicated by newlines.
*
* This class implements a Text_Wiki_Parse to mark implied line breaks in the
* source text, usually a single carriage return in the middle of a paragraph
* or block-quoted text.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Newline extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = '/([^\n])\n([^\n])/m';
/**
*
* Generates a replacement token for the matched text.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return string A delimited token to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
return $matches[1] .
$this->wiki->addToken($this->rule) .
$matches[2];
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for paragraph blocks.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Paragraph.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for paragraph blocks.
*
* This class implements a Text_Wiki rule to find sections of the source
* text that are paragraphs. A para is any line not starting with a token
* delimiter, followed by two newlines.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Paragraph extends Text_Wiki_Parse {
/**
*
* The regular expression used to find source text matching this
* rule.
*
* @access public
*
* @var string
*
*/
var $regex = "/^.*?\n\n/m";
var $conf = array(
'skip' => array(
'blockquote', // are we sure about this one?
'code',
'heading',
'horiz',
'deflist',
'table',
'list',
'toc'
)
);
/**
*
* Generates a token entry for the matched text. Token options are:
*
* 'start' => The starting point of the paragraph.
*
* 'end' => The ending point of the paragraph.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token number to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
$delim = $this->wiki->delim;
// was anything there?
if (trim($matches[0]) == '') {
return '';
}
// does the match start with a delimiter?
if (substr($matches[0], 0, 1) != $delim) {
// no.
$start = $this->wiki->addToken(
$this->rule, array('type' => 'start')
);
$end = $this->wiki->addToken(
$this->rule, array('type' => 'end')
);
return $start . trim($matches[0]) . $end;
}
// the line starts with a delimiter. read in the delimited
// token number, check the token, and see if we should
// skip it.
// loop starting at the second character (we already know
// the first is a delimiter) until we find another
// delimiter; the text between them is a token key number.
$key = '';
$len = strlen($matches[0]);
for ($i = 1; $i < $len; $i++) {
$char = $matches[0]{$i};
if ($char == $delim) {
break;
} else {
$key .= $char;
}
}
// look at the token and see if it's skippable (if we skip,
// it will not be marked as a paragraph)
$token_type = strtolower($this->wiki->tokens[$key][0]);
$skip = $this->getConf('skip', array());
if (in_array($token_type, $skip)) {
// this type of token should not have paragraphs applied to it.
// return the entire matched text.
return $matches[0];
} else {
$start = $this->wiki->addToken(
$this->rule, array('type' => 'start')
);
$end = $this->wiki->addToken(
$this->rule, array('type' => 'end')
);
return $start . trim($matches[0]) . $end;
}
}
}
?>
\ No newline at end of file
<?php
/**
*
* Find source text marked for lookup in the PHP online manual.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Phplookup.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Find source text marked for lookup in the PHP online manual.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Phplookup extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/\[\[php (.+?)\]\]/";
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* teletype text. The text itself is left in the source.
*
* @access public
*
* @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 teletype text.
*
*/
function process(&$matches)
{
return $this->wiki->addToken(
$this->rule, array('text' => $matches[1])
);
}
}
?>
\ No newline at end of file
<?php
/**
*
* "Pre-filter" the source text.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Prefilter.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* "Pre-filter" the source text.
*
* Convert DOS and Mac line endings to Unix, concat lines ending in a
* backslash \ with the next line, convert tabs to 4-spaces, add newlines
* to the top and end of the source text, compress 3 or more newlines to
* 2 newlines.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Prefilter extends Text_Wiki_Parse {
/**
*
* Simple parsing method.
*
* @access public
*
*/
function parse()
{
// convert DOS line endings
$this->wiki->source = str_replace("\r\n", "\n",
$this->wiki->source);
// convert Macintosh line endings
$this->wiki->source = str_replace("\r", "\n",
$this->wiki->source);
// concat lines ending in a backslash
$this->wiki->source = str_replace("\\\n", "",
$this->wiki->source);
// convert tabs to four-spaces
$this->wiki->source = str_replace("\t", " ",
$this->wiki->source);
// add extra newlines at the top and end; this
// seems to help many rules.
$this->wiki->source = "\n" . $this->wiki->source . "\n\n";
// finally, compress all instances of 3 or more newlines
// down to two newlines.
$find = "/\n{3,}/m";
$replace = "\n\n";
$this->wiki->source = preg_replace($find, $replace,
$this->wiki->source);
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for text marked as "raw" (i.e., to be rendered as-is).
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Raw.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for text marked as "raw" (i.e., to be rendered as-is).
*
* This class implements a Text_Wiki rule to find sections of the source
* text that are not to be processed by Text_Wiki. These blocks of "raw"
* text will be rendered as they were found.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Raw extends Text_Wiki_Parse {
/**
*
* The regular expression used to find source text matching this
* rule.
*
* @access public
*
* @var string
*
*/
var $regex = "/``(.*)``/U";
/**
*
* Generates a token entry for the matched text. Token options are:
*
* 'text' => The full matched text.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A delimited token number to be used as a placeholder in
* the source text.
*
*/
function process(&$matches)
{
$options = array('text' => $matches[1]);
return $this->wiki->addToken($this->rule, $options);
}
}
?>
\ No newline at end of file
<?php
/**
*
* Parses for text marked as revised (insert/delete).
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Revise.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for text marked as revised (insert/delete).
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Revise extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/\@\@({*?.*}*?)\@\@/U";
/**
*
* Config options.
*
* @access public
*
* @var array
*
*/
var $conf = array(
'delmark' => '---',
'insmark' => '+++'
);
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* inserted text. The text itself is left in the source.
*
* @access public
*
* @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 teletype text.
*
*/
function process(&$matches)
{
$output = '';
$src = $matches[1];
$delmark = $this->getConf('delmark'); // ---
$insmark = $this->getConf('insmark'); // +++
// '---' must be before '+++' (if they both appear)
$del = strpos($src, $delmark);
$ins = strpos($src, $insmark);
// if neither is found, return right away
if ($del === false && $ins === false) {
return $matches[0];
}
// handle text to be deleted
if ($del !== false) {
// move forward to the end of the deletion mark
$del += strlen($delmark);
if ($ins === false) {
// there is no insertion text following
$text = substr($src, $del);
} else {
// there is insertion text following,
// mitigate the length
$text = substr($src, $del, $ins - $del);
}
$output .= $this->wiki->addToken(
$this->rule, array('type' => 'del_start')
);
$output .= $text;
$output .= $this->wiki->addToken(
$this->rule, array('type' => 'del_end')
);
}
// handle text to be inserted
if ($ins !== false) {
// move forward to the end of the insert mark
$ins += strlen($insmark);
$text = substr($src, $ins);
$output .= $this->wiki->addToken(
$this->rule, array('type' => 'ins_start')
);
$output .= $text;
$output .= $this->wiki->addToken(
$this->rule, array('type' => 'ins_end')
);
}
return $output;
}
}
?>
\ No newline at end of file
<?php
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
/**
* Default: Parses for smileys / emoticons tags
*
* This class implements a Text_Wiki_Rule to find source text marked as
* smileys defined by symbols as ':)' , ':-)' or ':smile:'
* The symbol is replaced with a token.
*
* PHP versions 4 and 5
*
* @category Text
* @package Text_Wiki
* @author Bertrand Gugger <bertrand@toggg.com>
* @copyright 2005 bertrand Gugger
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version CVS: $Id: Smiley.php,v 1.6 2005/10/04 08:17:51 toggg Exp $
* @link http://pear.php.net/package/Text_Wiki
*/
/**
* Smiley rule parser class for Default.
*
* @category Text
* @package Text_Wiki
* @author Bertrand Gugger <bertrand@toggg.com>
* @copyright 2005 bertrand Gugger
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version Release: @package_version@
* @link http://pear.php.net/package/Text_Wiki
* @see Text_Wiki_Parse::Text_Wiki_Parse()
*/
class Text_Wiki_Parse_Smiley extends Text_Wiki_Parse {
/**
* Configuration keys for this rule
* 'smileys' => array Smileys recognized by this rule, symbols key definitions:
* 'symbol' => array ( 'name', 'description' [, 'variante', ...] ) as
* ':)' => array('smile', 'Smile'),
* ':D' => array('biggrin', 'Very Happy',':grin:'),
* the eventual elements after symbol and description are variantes
*
* 'auto_nose' => boolean enabling the auto nose feature:
* auto build a variante for 2 chars symbols by inserting a '-' as ':)' <=> ':-)'
*
* @access public
* @var array 'config-key' => mixed config-value
*/
var $conf = array(
'smileys' => array(
':D' => array('biggrin', 'Very Happy', ':grin:'),
':)' => array('smile', 'Smile', '(:'),
':(' => array('sad', 'Sad', '):'),
':o' => array('surprised', 'Surprised', ':eek:', 'o:'),
':shock:' => array('eek', 'Shocked'),
':?' => array('confused', 'Confused', ':???:'),
'8)' => array('cool', 'Cool', '(8'),
':lol:' => array('lol', 'Laughing'),
':x' => array('mad', 'Mad'),
':P' => array('razz', 'Razz'),
':oops:' => array('redface', 'Embarassed'),
':cry:' => array('cry', 'Crying or Very sad'),
':evil:' => array('evil', 'Evil or Very Mad'),
':twisted:' => array('twisted', 'Twisted Evil'),
':roll:' => array('rolleyes', 'Rolling Eyes'),
';)' => array('wink', 'Wink', '(;'),
':!:' => array('exclaim', 'Exclamation'),
':?:' => array('question', 'Question'),
':idea:' => array('idea', 'Idea'),
':arrow:' => array('arrow', 'Arrow'),
':|' => array('neutral', 'Neutral', '|:'),
':mrgreen:' => array('mrgreen', 'Mr. Green'),
),
'auto_nose' => true
);
/**
* Definition array of smileys, variantes references their model
* 'symbol' => array ( 'name', 'description')
*
* @access private
* @var array 'config-key' => mixed config-value
*/
var $_smileys = array();
/**
* Constructor.
* We override the constructor to build up the regex from config
*
* @param object &$obj the base conversion handler
* @return The parser object
* @access public
*/
function Text_Wiki_Parse_Smiley(&$obj)
{
$default = $this->conf;
parent::Text_Wiki_Parse($obj);
// read the list of smileys to sort out variantes and :xxx: while building the regexp
$this->_smileys = $this->getConf('smileys', $default['smileys']);
$autoNose = $this->getConf('auto_nose', $default['auto_nose']);
$reg1 = $reg2 = '';
$sep1 = ':(?:';
$sep2 = '';
foreach ($this->_smileys as $smiley => $def) {
for ($i = 1; $i < count($def); $i++) {
if ($i > 1) {
$cur = $def[$i];
$this->_smileys[$cur] = &$this->_smileys[$smiley];
} else {
$cur = $smiley;
}
$len = strlen($cur);
if (($cur{0} == ':') && ($len > 2) && ($cur{$len - 1} == ':')) {
$reg1 .= $sep1 . preg_quote(substr($cur, 1, -1), '#');
$sep1 = '|';
continue;
}
if ($autoNose && ($len === 2)) {
$variante = $cur{0} . '-' . $cur{1};
$this->_smileys[$variante] = &$this->_smileys[$smiley];
$cur = preg_quote($cur{0}, '#') . '-?' . preg_quote($cur{1}, '#');
} else {
$cur = preg_quote($cur, '#');
}
$reg2 .= $sep2 . $cur;
$sep2 = '|';
}
}
$delim = '[\n\r\s' . $this->wiki->delim . '$^]';
$this->regex = '#(?<=' . $delim .
')(' . ($reg1 ? $reg1 . '):' . ($reg2 ? '|' : '') : '') . $reg2 .
')(?=' . $delim . ')#i';
}
/**
* Generates a replacement token for the matched text. Token options are:
* 'symbol' => the original marker
* 'name' => the name of the smiley
* 'desc' => the description of the smiley
*
* @param array &$matches The array of matches from parse().
* @return string Delimited token representing the smiley
* @access public
*/
function process(&$matches)
{
// tokenize
return $this->wiki->addToken($this->rule,
array(
'symbol' => $matches[1],
'name' => $this->_smileys[$matches[1]][0],
'desc' => $this->_smileys[$matches[1]][1]
));
}
}
?>
<?php
/**
*
* Parses for strongly-emphasized text.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
* @license LGPL
*
* @version $Id: Strong.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
*
*/
/**
*
* Parses for strongly-emphasized text.
*
* This class implements a Text_Wiki_Parse to find source text marked for
* strong emphasis (bold) as defined by text surrounded by three
* single-quotes. On parsing, the text itself is left in place, but the
* starting and ending instances of three single-quotes are replaced with
* tokens.
*
* @category Text
*
* @package Text_Wiki
*
* @author Paul M. Jones <pmjones@php.net>
*
*/
class Text_Wiki_Parse_Strong extends Text_Wiki_Parse {
/**
*
* The regular expression used to parse the source text and find
* matches conforming to this rule. Used by the parse() method.
*
* @access public
*
* @var string
*
* @see parse()
*
*/
var $regex = "/\*\*(.*?)\*\*/";
/**
*
* Generates a replacement for the matched text. Token options are:
*
* 'type' => ['start'|'end'] The starting or ending point of the
* emphasized text. The text itself is left in the source.
*
* @access public
*
* @param array &$matches The array of matches from parse().
*
* @return A pair of delimited tokens to be used as a placeholder in
* the source text surrounding the text to be emphasized.
*
*/
function process(&$matches)
{
$start = $this->wiki->addToken(
$this->rule, array('type' => 'start')
);
$end = $this->wiki->addToken(
$this->rule, array('type' => 'end')
);
return $start . $matches[1] . $end;
}
}
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
class Text_Wiki_Render_Latex_Freelink extends Text_Wiki_Render_Latex_Wikilink {
// renders identically to wikilinks, only the parsing is different :-)
}
?>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment