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

Class: Text_Wiki_Parse_Code

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

Class Overview

Text_Wiki_Parse
   |
   --Text_Wiki_Parse_Code

Parses for text marked as a code example block.


Author(s):

Version:

  • Release: @package_version@

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 36]
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

  1.  on a line by itself,
  2.  followed by the inline code exampleand terminated with the string
on a line by itself. The code example is run through the native PHP highlight_string() function to colorize it, then surrounded with
...
tags when rendered as XHTML.



[ Top ]


Class Variables

$regex =  ';<code(\s[^>]*)?>(?:<pre>)?\n?((?:(?R)|.)*?)(?:</pre>)?\n?</code>;msi'

[line 45]

The regular expression used to find source text matching this rule.
  • Access: public

Type:   string


[ Top ]



Method Detail

process   [line 56]

A process( array &$matches)

Generates a token entry for the matched text. Token options are: 'text' => The full matched text, not including the tags.
  • Return: delimited token number to be used as a placeholder in the source text.
  • Access: public

Parameters:

array   &$matches   —  The array of matches from parse().

[ Top ]


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