Text_Wiki
[ class tree: Text_Wiki ] [ index: Text_Wiki ] [ all elements ]

Class: Text_Wiki_Parse_Emphasis

Source Location: /Text_Wiki_Mediawiki-0.2.0/Text/Wiki/Parse/Mediawiki/Emphasis.php

Class Overview

Text_Wiki_Parse
   |
   --Text_Wiki_Parse_Emphasis

Emphazised text rule parser class for Mediawiki. Makes Emphasis, Strong or both This class implements a Text_Wiki_Parse to find source text marked for emphasis, stronger and very as defined by text surrounded by 2,3 or 5 single-quotes.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2005 bertrand Gugger

Methods


Inherited Variables

Inherited Methods


Class Details

[line 42]
Emphazised text rule parser class for Mediawiki. Makes Emphasis, Strong or both This class implements a Text_Wiki_Parse to find source text marked for emphasis, stronger and very as defined by text surrounded by 2,3 or 5 single-quotes.

On parsing, the text itself is left in place, but the starting and ending instances of the single-quotes are replaced with tokens.

This class does not follow the standard structure of other Text_Wiki_Parse class and is heavily based on the code from Mediawiki (Parser::doAllQuotes() and Parser::doQuotes()) that handles emphazised text



[ Top ]


Method Detail

parse   [line 51]

void parse( )

Split $this->wiki->source by line break and call $this->process() for each line of the source text
  • Access: public

[ Top ]

process   [line 73]

string process( string $text)

Generates a replacement for the matched text. Token options are:
  • 'type' => ['start'|'end'] The starting or ending point of the emphasized text.

Generated tokens are Emphasis (this rule), Strong or Emphasis / Strong The text itself is left in the source but may content bested blocks

This function is basically a copy of Parser::doQuotes() from the Mediawiki software. The algorithm is the same but instead of replacing the syntax by HTML we replace by tokens

  • Return: the source line with the wiki syntax replaced by tokens

Parameters:

string   $text   —  a line from $this->wiki->source

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:32:43 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.