$this->mTransparentTagHooks = array();
$this->mFunctionHooks = array();
$this->mFunctionSynonyms = array( 0 => array(), 1 => array() );
- $this->mDefaultStripList = $this->mStripList = array( 'nowiki', 'gallery', 'poem' );
+ $this->mDefaultStripList = $this->mStripList = array( 'nowiki', 'gallery' );
$this->mUrlProtocols = wfUrlProtocols();
$this->mExtLinkBracketedRegex = '/\[(\b(' . wfUrlProtocols() . ')'.
'[^][<>"\\x00-\\x20\\x7F]+) *([^\]\\x0a\\x0d]*?)\]/S';
case 'gallery':
$output = $this->renderImageGallery( $content, $attributes );
break;
- case 'poem':
- $output = $this->renderPoem( $content, $attributes );
- break;
default:
if( isset( $this->mTagHooks[$name] ) ) {
# Workaround for PHP bug 35229 and similar
return $ig->toHTML();
}
- /** Renders any text in between <poem></poem> tags
- * based on http://www.mediawiki.org/wiki/Extension:Poem
- */
-
- function renderPoem( $in, $param = array() ) {
-
- /* using newlines in the text will cause the parser to add <p> tags,
- * which may not be desired in some cases
- */
- $nl = array_key_exists( 'compact', $param ) ? '' : "\n";
-
- $replacer = new DoubleReplacer( ' ', ' ' );
- $text = $this->recursiveTagParse( $in );
- $text = $this->mStripState->unstripNoWiki( $text );
- // Only strip the very first and very last \n (which trim cannot do)
- if( substr( $text, 0, 1 ) == "\n" )
- $text = substr( $text, 1 );
- if( substr( $text, -1 ) == "\n" )
- $text = substr( $text, 0, -1 );
-
- $text = str_replace( "\n", "<br />\n", $text );
- $text = preg_replace_callback(
- "/^( +)/m",
- $replacer->cb(),
- $text );
-
- // Pass HTML attributes through to the output.
- $attribs = Sanitizer::validateTagAttributes( $param, 'div' );
-
- // Wrap output in a <div> with "poem" class.
- if( array_key_exists( 'class', $attribs ) ) {
- $attribs['class'] = 'poem ' . $attribs['class'];
- } else {
- $attribs['class'] = 'poem';
- }
-
- return Xml::openElement( 'div', $attribs ) . $nl . trim( $text ) . $nl . Xml::closeElement( 'div' );
- }
-
function getImageParams( $handler ) {
if ( $handler ) {
$handlerClass = get_class( $handler );