MediaWiki REL1_31
Poem Class Reference

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

Static Public Member Functions

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

Static Protected Member Functions

static indentVerse (array $m)
 Callback for preg_replace_callback() that wraps content in an indented span.
 
static replaceSpaces (array $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.

Note
CC0-1.0
Author
Nikola Smolenski smole.nosp@m.nsk@.nosp@m.eunet.nosp@m..yu

Definition at line 10 of file Poem.php.

Member Function Documentation

◆ indentVerse()

static Poem::indentVerse ( array $m)
staticprotected

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

Parameters
string[]$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 79 of file Poem.php.

References $attribs.

◆ init()

static Poem::init ( Parser $parser)
static

Bind the renderPoem function to the <poem> tag.

Parameters
Parser$parser

Definition at line 15 of file Poem.php.

References $parser.

◆ renderPoem()

static Poem::renderPoem ( $in,
array $param = [],
Parser $parser,
PPFrame $frame )
static

Parse the text into proper poem format.

Parameters
string | null$inThe text inside the poem tag
string[]$param
Parser$parser
PPFrame$frame
Returns
string

Definition at line 27 of file Poem.php.

References $attribs, and $parser.

◆ replaceSpaces()

static Poem::replaceSpaces ( array $m)
staticprotected

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

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

Definition at line 68 of file Poem.php.


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