Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7462935
FigureHandler.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
FigureHandler.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Wikimedia\Parsoid\Html2Wt\DOMHandlers
;
use
Wikimedia\Parsoid\Core\MediaStructure
;
use
Wikimedia\Parsoid\DOM\Element
;
use
Wikimedia\Parsoid\DOM\Node
;
use
Wikimedia\Parsoid\Html2Wt\LinkHandlerUtils
;
use
Wikimedia\Parsoid\Html2Wt\SerializerState
;
use
Wikimedia\Parsoid\Utils\DOMUtils
;
use
Wikimedia\Parsoid\Utils\WTUtils
;
class
FigureHandler
extends
DOMHandler
{
public
function
__construct
()
{
parent
::
__construct
(
false
);
}
/** @inheritDoc */
public
function
handle
(
Element
$node
,
SerializerState
$state
,
bool
$wrapperUnmodified
=
false
):
?
Node
{
LinkHandlerUtils
::
figureHandler
(
$state
,
$node
,
MediaStructure
::
parse
(
$node
)
);
return
$node
->
nextSibling
;
}
/** @inheritDoc */
public
function
before
(
Element
$node
,
Node
$otherNode
,
SerializerState
$state
):
array
{
if
(
WTUtils
::
isNewElt
(
$node
)
&&
DOMUtils
::
atTheTop
(
$node
->
parentNode
)
)
{
return
[
'min'
=>
1
];
}
return
[];
}
/** @inheritDoc */
public
function
after
(
Element
$node
,
Node
$otherNode
,
SerializerState
$state
):
array
{
if
(
WTUtils
::
isNewElt
(
$node
)
&&
DOMUtils
::
atTheTop
(
$node
->
parentNode
)
)
{
return
[
'min'
=>
1
];
}
return
[];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 23, 03:51 (3 d, 21 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
05/30/c80db785c11084c7c9f0a6011a08
Default Alt Text
FigureHandler.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment