MediaWiki master
MediaWiki\Parser\CoreTagHooks Class Reference

Various tag hooks, registered in every Parser. More...

Static Public Member Functions

static gallery (?string $content, array $attributes, Parser $parser)
 Core parser tag hook function for 'gallery'.
 
static html (?string $content, array $attributes, Parser $parser)
 Core parser tag hook function for 'html', used only when $wgRawHtml is enabled.
 
static indicator (?string $content, array $attributes, Parser $parser, PPFrame $frame)
 XML-style tag for page status indicators: icons (or short text snippets) usually displayed in the top-right corner of the page, outside of the main content.
 
static langconvert (?string $content, array $attributes, Parser $parser, PPFrame $frame)
 Returns content converted into the requested language variant, using LanguageConverter.
 
static nowiki (?string $content, array $attributes, Parser $parser)
 Core parser tag hook function for 'nowiki'.
 
static pre (?string $content, array $attribs, Parser $parser, PPFrame $frame)
 Core parser tag hook function for 'pre'.
 
static register (Parser $parser, ServiceOptions $options)
 

Detailed Description

Various tag hooks, registered in every Parser.

Deprecated
since 1.46, use the ParserCoreTagHooks service instead.

Definition at line 20 of file CoreTagHooks.php.

Member Function Documentation

◆ gallery()

static MediaWiki\Parser\CoreTagHooks::gallery ( ?string $content,
array $attributes,
Parser $parser )
static

Core parser tag hook function for 'gallery'.

Renders a thumbnail list of the given images, with optional captions. Full syntax documented on the wiki:

https://www.mediawiki.org/wiki/Help:Images#Gallery_syntax

Todo
break Parser::renderImageGallery out here too.
Parameters
?string$content
array$attributes
Parser$parser
Returns
string HTML
Access: internal
Deprecated
since 1.46; use the ParserCoreTagHooks service instead

Definition at line 123 of file CoreTagHooks.php.

◆ html()

static MediaWiki\Parser\CoreTagHooks::html ( ?string $content,
array $attributes,
Parser $parser )
static

Core parser tag hook function for 'html', used only when $wgRawHtml is enabled.

This is potentially unsafe and should be used only in very careful circumstances, as the contents are emitted as raw HTML.

Uses undocumented extended tag hook return values, introduced in r61913.

Parameters
?string$content
array$attributes
Parser$parser
Returns
array|string Output of tag hook
Access: internal
Deprecated
since 1.46; use the ParserCoreTagHooks service instead

Definition at line 75 of file CoreTagHooks.php.

References MediaWiki\MediaWikiServices\getInstance(), and wfDeprecated().

◆ indicator()

static MediaWiki\Parser\CoreTagHooks::indicator ( ?string $content,
array $attributes,
Parser $parser,
PPFrame $frame )
static

XML-style tag for page status indicators: icons (or short text snippets) usually displayed in the top-right corner of the page, outside of the main content.

Parameters
?string$content
array$attributes
Parser$parser
PPFrame$frame
Returns
string
Since
1.25
Access: internal
Deprecated
since 1.46; use the ParserCoreTagHooks service instead

Definition at line 143 of file CoreTagHooks.php.

◆ langconvert()

static MediaWiki\Parser\CoreTagHooks::langconvert ( ?string $content,
array $attributes,
Parser $parser,
PPFrame $frame )
static

Returns content converted into the requested language variant, using LanguageConverter.

Parameters
?string$content
array$attributes
Parser$parser
PPFrame$frame
Returns
array
Since
1.36
Access: internal
Deprecated
since 1.46; use the ParserCoreTagHooks service instead

Definition at line 162 of file CoreTagHooks.php.

◆ nowiki()

static MediaWiki\Parser\CoreTagHooks::nowiki ( ?string $content,
array $attributes,
Parser $parser )
static

Core parser tag hook function for 'nowiki'.

Text within this section gets interpreted as a string of text with HTML-compatible character references, and wiki markup within it will not be expanded.

Uses undocumented extended tag hook return values, introduced in r61913.

Uses custom html escaping which phan-taint-check won't recognize hence we suppress the error.

Parameters
?string$content
array$attributes
Parser$parser
Returns
array
Access: internal
Deprecated
since 1.46; use the ParserCoreTagHooks service instead

Definition at line 99 of file CoreTagHooks.php.

◆ pre()

static MediaWiki\Parser\CoreTagHooks::pre ( ?string $content,
array $attribs,
Parser $parser,
PPFrame $frame )
static

Core parser tag hook function for 'pre'.

Text is treated roughly as 'nowiki' wrapped in an HTML 'pre' tag; valid HTML attributes are passed on.

Parameters
?string$content
array$attribs
Parser$parser
PPFrame$frame
Returns
string HTML
Access: internal
Deprecated
since 1.46; use the ParserCoreTagHooks service instead

Definition at line 50 of file CoreTagHooks.php.

◆ register()

static MediaWiki\Parser\CoreTagHooks::register ( Parser $parser,
ServiceOptions $options )
static
Parameters
Parser$parser
ServiceOptions$options
Returns
void
Access: internal
Deprecated
since 1.46; use the ParserCoreTagHooks service instead

Definition at line 30 of file CoreTagHooks.php.

References MediaWiki\MediaWikiServices\getInstance(), and wfDeprecated().


The documentation for this class was generated from the following file: