16 $parser->setHook(
'poem', [ self::class,
'renderPoem' ] );
30 $newline =
isset( $param[
'compact'] ) ?
'' :
"\n";
32 $tag =
$parser->insertStripItem(
"<br />" );
41 [
'/^\n/',
'/\n$/D',
'/(?<!^----)\n/m' ],
49 $text =
$parser->recursiveTagParse( $text, $frame );
53 $text =
str_replace(
'<hr />' . $tag,
'<hr />', $text );
55 $attribs = Sanitizer::validateTagAttributes( $param,
'div' );
64 return Html::rawElement(
'div',
$attribs, $newline .
trim( $text ) . $newline );
86 'class' =>
'mw-poem-indented',
87 'style' =>
'display: inline-block; margin-left: ' .
strlen( $m[1] ) .
'em;'
90 return Html::rawElement(
'span',
$attribs, $m[2] );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
This class handles formatting poems in WikiText, specifically anything within <poem></poem> tags.
static replaceSpaces(array $m)
Callback for preg_replace_callback() that replaces spaces with non-breaking spaces.
static indentVerse(array $m)
Callback for preg_replace_callback() that wraps content in an indented span.
static renderPoem( $in, array $param, Parser $parser, PPFrame $frame)
Parse the text into proper poem format.
static init(Parser $parser)
Bind the renderPoem function to the <poem> tag.
see documentation in includes Linker php for Linker::makeImageLink or false for current used if you return false $parser
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))