Remove <metadesc>

The {{description2}} parser function is still present. The <metadesc>
hooks was just added "so that Description2 can be used as a
replacement for Extension:MetaDescriptionTag", but MW 1.35 deprecated
and 1.36 removed support for Parser::setFunctionTagHook.

Bug: T236809
Change-Id: I53710f0d0a7bc8de4a3404b6df9ccbd1381cf36d
This commit is contained in:
C. Scott Ananian 2020-08-26 18:45:15 -04:00
parent 51cb6f1465
commit 70325b3952

View file

@ -81,11 +81,6 @@ class Description2 {
[ static::class, 'parserFunctionCallback' ],
Parser::SFH_OBJECT_ARGS
);
$parser->setFunctionTagHook(
'metadesc',
[ static::class, 'tagCallback' ],
Parser::SFH_OBJECT_ARGS
);
return true;
}
@ -101,22 +96,6 @@ class Description2 {
return '';
}
/**
* @param Parser $parser The parser.
* @param PPFrame $frame Not used.
* @param string $content The contents of the tag (if any).
* @param string[] $attributes The tag attributes (if any).
* @return string
*/
public static function tagCallback( Parser $parser, PPFrame $frame, $content, $attributes ) {
$contentAttr = isset( $attributes['content'] ) ? $attributes['content'] : null;
$desc = isset( $content ) ? $content : $contentAttr;
if ( isset( $desc ) ) {
self::setDescription( $parser, $desc );
}
return '';
}
/**
* @param OutputPage &$out The output page to add the meta element to.
* @param ParserOutput $parserOutput The parser output to get the description from.