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

Class: Text_Wiki_Parse_Code

Source Location: /Text_Wiki_Cowiki-0.0.2/Text/Wiki/Parse/Cowiki/Code.php

Class Overview


Parses for text marked as a code example block.




Inherited Variables

Inherited Methods

Class Details

[line 38]
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( [^>]*)?>)\n(.+)\n(<\/code>)(\s|$)/Umsi'

[line 52]

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

Type:   string

[ Top ]

Method Detail

process   [line 70]

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


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

[ Top ]

Documentation generated on Mon, 11 Mar 2019 14:52:58 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.