Phpfox_Parse_Wiki

Description

WIKI Parser Clones how a common WIKI works and allows the ability for users to use WIKI code to create pages.

  • author: Raymond Benc
  • version: $Id: wiki.class.php 1687 2010-07-22 03:13:27Z Raymond_Benc $
  • copyright: [PHPFOX_COPYRIGHT]

Located in /include/library/phpfox/parse/wiki.class.php (line 18)


	
			
Method Summary
 Phpfox_Parse_Wiki __construct ()
 string emphasize (int $iAmount)
 string emphasize_off ()
 string parse (string $sText, [string $sTitle = ''])
 string _cleanTitle (string $sTxt)
 string _handleDefinitionList (array $aMatches, [bool $bClose = false])
 string _handleEliminate ( $aMatches)
 string _handleEmphasize (array $aMatches)
 string _handleExternalLink (array $aMatches)
 string _handleHorizontalRule (array $aMatches)
 string _handleImage (string $sHref, string $sTitle, array $aOptions)
 string _handleInternalLink (array $aMatches)
 string _handleList (array $aMatches, [bool $bClose = false])
 string _handleNewline (array $aMatches)
 string _handlePreFormat (array $aMatches, [bool $bClose = false])
 string _handleRestoreNoWiki (array $aMatches)
 string _handleSaveNoWiki (array $aMatches)
 string _handleSections (array $aMatches)
 string _handleVariable (array $aMatches)
 string _parseLine (string $sLine)
Variables
array $_aEmphasis = array() (line 87)

ARRAY of emphasis tags.

  • access: private
array $_aListLevelTypes = array() (line 101)
  • access: private
array $_aNoWikis = array() (line 94)

ARRAY of support nowiki tags.

  • access: private
bool $_bDefList = false (line 115)

Support for <dl>.

  • access: private
bool $_bIgnoreImages = true (line 66)

BOOL to ignore images or not.

  • access: private
bool $_bPreformat = false (line 80)

Format

  • access: private
bool $_bRedirect = false (line 73)

Redirect links.

  • access: private
bool $_bStop = false (line 136)

Create a link break.

  • access: private
bool $_bSuppressLinebreaks = false (line 129)

Supress link breaks.

  • access: private
int $_iLinkNumber = 0 (line 122)

Link number.

  • access: private
int $_iListLevel = 0 (line 108)

Define how many levels a list has.

  • access: private
array $_sCharRegexes = array(
'internallink' => '(\[\[(([^\]]*?)\:)?([^\]]*?)(\|([^\]]*?))?\]\]([a-z]+)?)',
'externallink' => '(\[([^\]]*?)(\s+[^\]]*?)?\])',
'emphasize' => '(\'{2,5})',
'eliminate' => '(__TOC__|__NOTOC__|__NOEDITSECTION__)',
'variable' => '(\{\{([^\}]*?)\}\})'
)
(line 39)

Common character regex.

  • access: private
string $_sImageUri (line 59)

Image URI.

  • access: private
array $_sLineRegexes = array(
'preformat' => '^\s(.*?)$',
'definitionlist' => '^([\;\:])\s*(.*?)$',
'newline' => '^$',
'list' => '^([\*\#]+)(.*?)$',
'sections' => '^(={1,6})(.*?)(={1,6})$',
'horizontalrule' => '^----$'
)
(line 25)

Common regex for HTML.

  • access: private
string $_sReferenceWiki (line 52)

Reference within links.

  • access: private
Methods
Constructor __construct (line 142)

Class constructor.

  • access: public
Phpfox_Parse_Wiki __construct ()
emphasize (line 528)

Handles emphasize blocks (em, strong).

  • return: Converted HTML.
  • access: private
string emphasize (int $iAmount)
  • int $iAmount: Type of HTML.
emphasize_off (line 567)

Checks emphasize diff.

  • return: Converted HTML.
  • access: private
string emphasize_off ()
parse (line 153)

Parse string and converts WIKI code into HTML.

  • return: Converted text from WIKI to HTML.
  • access: public
string parse (string $sText, [string $sTitle = ''])
  • string $sText: Text to parse.
  • string $sTitle: Title of this page.
_cleanTitle (line 264)

Cleans the title of an item.

  • return: Title all clean.
  • access: private
string _cleanTitle (string $sTxt)
  • string $sTxt: Title of the item.
_handleDefinitionList (line 342)

Handle <dl>.

  • return: Converted HTML.
  • access: private
string _handleDefinitionList (array $aMatches, [bool $bClose = false])
  • array $aMatches: ARRAY matches from regex.
  • bool $bClose: TRUE to close the <dl>. FALSE to leave it open.
_handleEliminate (line 592)

Adds empty string.

  • return: Empty string.
  • access: private
string _handleEliminate ( $aMatches)
  • $aMatches
_handleEmphasize (line 557)

Handles emphasize blocks (em, strong).

  • return: Converted HTML.
  • access: private
string _handleEmphasize (array $aMatches)
  • array $aMatches: ARRAY matches from regex.
_handleExternalLink (line 508)

Handles external links.

  • return: Converted HTML.
  • access: private
string _handleExternalLink (array $aMatches)
  • array $aMatches: ARRAY matches from regex.
_handleHorizontalRule (line 415)

Handle <hr />

  • return: Converted HTML.
  • access: private
string _handleHorizontalRule (array $aMatches)
  • array $aMatches: ARRAY matches from regex.
_handleImage (line 428)

Handle images (<img>).

  • return: Converted HTML.
  • access: private
string _handleImage (string $sHref, string $sTitle, array $aOptions)
  • string $sHref: Link
  • string $sTitle: Title
  • array $aOptions: Extra options for the link.
_handleInternalLink (line 465)

Handles internal links.

  • return: Converted HTML.
  • access: private
string _handleInternalLink (array $aMatches)
  • array $aMatches: ARRAY matches from regex.
_handleList (line 296)

Handles lists (

  • return: Converted HTML.
  • access: private
string _handleList (array $aMatches, [bool $bClose = false])
  • array $aMatches: ARRAY matches from regex.
  • bool $bClose: TRUE to close the
_handleNewline (line 277)

Handler for new lines (
).

  • return: Converted HTML.
  • access: private
string _handleNewline (array $aMatches)
  • array $aMatches: ARRAY matches from regex.
_handlePreFormat (line 387)

Handle

  • return: Converted HTML.
  • access: private
string _handlePreFormat (array $aMatches, [bool $bClose = false])
  • array $aMatches: ARRAY matches from regex.
  • bool $bClose: TRUE to close the
_handleRestoreNoWiki (line 641)

Restores wiki.

  • return: Converted HTML.
  • access: private
string _handleRestoreNoWiki (array $aMatches)
  • array $aMatches: ARRAY matches from regex.
_handleSaveNoWiki (line 628)

Handles <nowiki>.

  • return: Converted HTML.
  • access: private
string _handleSaveNoWiki (array $aMatches)
  • array $aMatches: ARRAY matches from regex.
_handleSections (line 248)

Handles sections (h1, h2, h3 etc...)

  • return: Converted HTML line.
  • access: private
string _handleSections (array $aMatches)
  • array $aMatches: ARRAY matches from regex.
_handleVariable (line 603)

Converts WIKI variables.

  • return: Converted HTML.
  • access: private
string _handleVariable (array $aMatches)
  • array $aMatches: ARRAY matches from regex.
_parseLine (line 181)

Parses each line of the string and creates handles.

  • return: Returns the parsed line.
  • access: private
string _parseLine (string $sLine)
  • string $sLine: Line of the string we are parsing.

Documentation generated on Tue, 28 Sep 2010 10:36:45 +0200 by phpDocumentor 1.4.0a2