setHook( "spoiler", "Spoilers::parseSpoilerTag" ); return true; } /** * Parses the tag. * * @access public * @param string User input between * @param array Array of arguments from the opening spoiler tag. * @param object Mediawiki Parser Object * @param object PPFrame object * @return string HTML */ static public function parseSpoilerTag( $input, array $args, Parser $parser, PPFrame $frame ) { $parser->getOutput()->addModules('ext.spoilers'); $renderedInput = $parser->recursiveTagParse( $input, $frame ); $showText = isset($args['show']) ? htmlentities( $args['show'], ENT_QUOTES) : wfMessage('spoilers_show_default' )->text(); $hideText = isset($args['hide']) ? htmlentities( $args['hide'], ENT_QUOTES ) : wfMessage('spoilers_hide_default')->text(); $output = "

{$showText} {$hideText}

"; return $output; } }