MediaWiki REL1_30
Poem Class Reference

This class handles formatting poems in WikiText, specifically anything within <poem></poem> tags. More...

Static Public Member Functions

static init (&$parser)
 Bind the renderPoem function to the <poem> tag.
 
static renderPoem ( $in, $param=[], $parser=null, $frame=false)
 Parse the text into proper poem format.
 

Static Protected Member Functions

static indentVerse ( $m)
 Callback for preg_replace_callback() that wraps content in an indented span.
 
static replaceSpaces ( $m)
 Callback for preg_replace_callback() that replaces spaces with non-breaking spaces.
 

Detailed Description

This class handles formatting poems in WikiText, specifically anything within <poem></poem> tags.

Definition at line 6 of file Poem.class.php.

Member Function Documentation

◆ indentVerse()

static Poem::indentVerse ( $m)
staticprotected

Callback for preg_replace_callback() that wraps content in an indented span.

Parameters
array$mMatches from the regular expression
  • $m[1] consists of 1 or more colons
  • $m[2] consists of the text after the colons
Returns
string

Definition at line 76 of file Poem.class.php.

References $attribs.

◆ init()

static Poem::init ( & $parser)
static

Bind the renderPoem function to the <poem> tag.

Parameters
Parser&$parser
Returns
bool true

Definition at line 12 of file Poem.class.php.

References $parser.

◆ renderPoem()

static Poem::renderPoem ( $in,
$param = [],
$parser = null,
$frame = false )
static

Parse the text into proper poem format.

Parameters
string$inThe text inside the poem tag
array$param
Parser$parser
bool$frame
Returns
string

Definition at line 25 of file Poem.class.php.

References $attribs, and $parser.

◆ replaceSpaces()

static Poem::replaceSpaces ( $m)
staticprotected

Callback for preg_replace_callback() that replaces spaces with non-breaking spaces.

Parameters
array$mMatches from the regular expression
  • $m[1] consists of 1 or more spaces
Returns
mixed

Definition at line 65 of file Poem.class.php.


The documentation for this class was generated from the following file: