Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1432453
RefProcessor.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
RefProcessor.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Cite\Parsoid
;
use
MediaWiki\Config\Config
;
use
Wikimedia\Parsoid\DOM\Element
;
use
Wikimedia\Parsoid\DOM\Node
;
use
Wikimedia\Parsoid\Ext\DOMProcessor
;
use
Wikimedia\Parsoid\Ext\ParsoidExtensionAPI
;
/**
* wt -> html DOM PostProcessor
* @license GPL-2.0-or-later
*/
class
RefProcessor
extends
DOMProcessor
{
private
Config
$mainConfig
;
public
function
__construct
(
Config
$mainConfig
)
{
$this
->
mainConfig
=
$mainConfig
;
}
/**
* @inheritDoc
*/
public
function
wtPostprocess
(
ParsoidExtensionAPI
$extApi
,
Node
$node
,
array
$options
):
void
{
$refsData
=
new
ReferencesData
();
$references
=
new
References
(
$this
->
mainConfig
);
$references
->
processRefs
(
$extApi
,
$refsData
,
$node
);
$references
->
insertMissingReferencesIntoDOM
(
$extApi
,
$refsData
,
$node
);
if
(
$refsData
->
embeddedErrors
)
{
$references
->
addEmbeddedErrors
(
$extApi
,
$refsData
,
$node
);
}
}
/**
* html -> wt DOM PreProcessor
*
* Nothing to do right now.
*
* But, for example, as part of some future functionality, this could be used to
* reconstitute page-level information from local annotations left behind by editing clients.
*/
public
function
htmlPreprocess
(
ParsoidExtensionAPI
$extApi
,
Element
$root
):
void
{
// TODO
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 21:46 (1 d, 6 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ca/34/569f0415fa40bcb06e7f5112c196
Default Alt Text
RefProcessor.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment