mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-12-19 02:00:40 +00:00
51c211047a
Change-Id: Ide9700747b3ecea9da59911c6eb342569be4c9b8
30 lines
678 B
PHP
30 lines
678 B
PHP
<?php
|
|
declare( strict_types = 1 );
|
|
|
|
namespace Wikimedia\Parsoid\Ext\Cite;
|
|
|
|
use DOMElement;
|
|
use Wikimedia\Parsoid\Ext\DOMProcessor;
|
|
use Wikimedia\Parsoid\Ext\ParsoidExtensionAPI;
|
|
|
|
/**
|
|
* wt -> html DOM PostProcessor
|
|
*/
|
|
class RefProcessor extends DOMProcessor {
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function wtPostprocess(
|
|
ParsoidExtensionAPI $extApi, DOMElement $body, array $options, bool $atTopLevel
|
|
): void {
|
|
if ( $atTopLevel ) {
|
|
$refsData = new ReferencesData();
|
|
References::processRefs( $extApi, $refsData, $body );
|
|
References::insertMissingReferencesIntoDOM( $extApi, $refsData, $body );
|
|
}
|
|
}
|
|
|
|
// FIXME: should implement an htmlPreprocess method as well.
|
|
}
|