mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-28 17:00:10 +00:00
1a371ec6a5
As of now, this patch does not touch the existing code. However, the goal is to remove a lot of the related code from the Cite class. This will be done in later patches. This here is a separate patch to make reviewing the later patches much easier. The existing parser tests should be proof enough this chain of patches is not changing any behavior. Change-Id: I27ae972f81071bb4036bd452560768fae409417b
40 lines
1 KiB
PHP
40 lines
1 KiB
PHP
<?php
|
|
|
|
class CiteParserTagHooks {
|
|
|
|
/**
|
|
* Parser hook for the <ref> tag.
|
|
*
|
|
* @param string|null $content Raw wikitext content of the <ref> tag.
|
|
* @param string[] $attributes
|
|
* @param Parser $parser
|
|
* @param PPFrame $frame
|
|
*
|
|
* @return string
|
|
*/
|
|
public static function ref( $content, array $attributes, Parser $parser, PPFrame $frame ) {
|
|
/** @var Cite $cite */
|
|
$cite = $parser->extCite;
|
|
// @phan-suppress-next-line SecurityCheck-XSS False positive
|
|
return $cite->ref( $content, $attributes, $parser, $frame );
|
|
}
|
|
|
|
/**
|
|
* Parser hook for the <references> tag.
|
|
*
|
|
* @param string|null $content Raw wikitext content of the <references> tag.
|
|
* @param string[] $attributes
|
|
* @param Parser $parser
|
|
* @param PPFrame $frame
|
|
*
|
|
* @return string
|
|
*/
|
|
public static function references( $content, array $attributes, Parser $parser, PPFrame $frame ) {
|
|
/** @var Cite $cite */
|
|
$cite = $parser->extCite;
|
|
// @phan-suppress-next-line SecurityCheck-XSS False positive
|
|
return $cite->references( $content, $attributes, $parser, $frame );
|
|
}
|
|
|
|
}
|