X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FCoreTagHooks.php;h=d4c4f6d2d07e4c05909f6909b435db4415ae5976;hb=e3bd13db0c285f312e31bb1b7271af4628cca80c;hp=df868eabd5cbc85332281f05cb9f4c48c4278f89;hpb=3e8c0191a3d2b3a94cd88ec4117381a5cddfb955;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/CoreTagHooks.php b/includes/parser/CoreTagHooks.php index df868eabd5..d4c4f6d2d0 100644 --- a/includes/parser/CoreTagHooks.php +++ b/includes/parser/CoreTagHooks.php @@ -32,12 +32,12 @@ class CoreTagHooks { */ public static function register( $parser ) { global $wgRawHtml; - $parser->setHook( 'pre', array( __CLASS__, 'pre' ) ); - $parser->setHook( 'nowiki', array( __CLASS__, 'nowiki' ) ); - $parser->setHook( 'gallery', array( __CLASS__, 'gallery' ) ); - $parser->setHook( 'indicator', array( __CLASS__, 'indicator' ) ); + $parser->setHook( 'pre', [ __CLASS__, 'pre' ] ); + $parser->setHook( 'nowiki', [ __CLASS__, 'nowiki' ] ); + $parser->setHook( 'gallery', [ __CLASS__, 'gallery' ] ); + $parser->setHook( 'indicator', [ __CLASS__, 'indicator' ] ); if ( $wgRawHtml ) { - $parser->setHook( 'html', array( __CLASS__, 'html' ) ); + $parser->setHook( 'html', [ __CLASS__, 'html' ] ); } } @@ -79,7 +79,7 @@ class CoreTagHooks { public static function html( $content, $attributes, $parser ) { global $wgRawHtml; if ( $wgRawHtml ) { - return array( $content, 'markerType' => 'nowiki' ); + return [ $content, 'markerType' => 'nowiki' ]; } else { throw new MWException( ' extension tag encountered unexpectedly' ); } @@ -98,8 +98,8 @@ class CoreTagHooks { * @return array */ public static function nowiki( $content, $attributes, $parser ) { - $content = strtr( $content, array( '-{' => '-{', '}-' => '}-' ) ); - return array( Xml::escapeTagsOnly( $content ), 'markerType' => 'nowiki' ); + $content = strtr( $content, [ '-{' => '-{', '}-' => '}-' ] ); + return [ Xml::escapeTagsOnly( $content ), 'markerType' => 'nowiki' ]; } /** @@ -141,7 +141,7 @@ class CoreTagHooks { $parser->getOutput()->setIndicator( trim( $attributes['name'] ), - $parser->recursiveTagParse( $content, $frame ) + Parser::stripOuterParagraph( $parser->recursiveTagParseFully( $content, $frame ) ) ); return '';