MediaWiki  1.23.13
CoreTagHooks Class Reference

Various tag hooks, registered in Parser::firstCallInit() More...

Static Public Member Functions

static gallery ( $content, $attributes, $parser)
 Core parser tag hook function for 'gallery'. More...
 
static html ( $content, $attributes, $parser)
 Core parser tag hook function for 'html', used only when $wgRawHtml is enabled. More...
 
static nowiki ( $content, $attributes, $parser)
 Core parser tag hook function for 'nowiki'. More...
 
static pre ( $text, $attribs, $parser)
 Core parser tag hook function for 'pre'. More...
 
static register ( $parser)
 

Detailed Description

Various tag hooks, registered in Parser::firstCallInit()

Definition at line 28 of file CoreTagHooks.php.

Member Function Documentation

◆ gallery()

static CoreTagHooks::gallery (   $content,
  $attributes,
  $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

Definition at line 119 of file CoreTagHooks.php.

References $parser.

◆ html()

static CoreTagHooks::html (   $content,
  $attributes,
  $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
$contentstring
$attributesarray
$parserParser
Exceptions
MWException
Returns
array

Definition at line 78 of file CoreTagHooks.php.

References array(), and global.

◆ nowiki()

static CoreTagHooks::nowiki (   $content,
  $attributes,
  $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.

Parameters
$contentstring
$attributesarray
$parserParser
Returns
array

Definition at line 99 of file CoreTagHooks.php.

References array(), and Xml\escapeTagsOnly().

◆ pre()

static CoreTagHooks::pre (   $text,
  $attribs,
  $parser 
)
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$text
array$attribs
Parser$parser
Returns
string HTML

Definition at line 53 of file CoreTagHooks.php.

References $attribs, StringUtils\delimiterReplace(), Xml\escapeTagsOnly(), Xml\openElement(), and Sanitizer\validateTagAttributes().

◆ register()

static CoreTagHooks::register (   $parser)
static
Parameters
$parserParser
Returns
void

Definition at line 33 of file CoreTagHooks.php.

References $parser, array(), and global.


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