Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7435712
CaptionHandler.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
CaptionHandler.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Wikimedia\Parsoid\Html2Wt\DOMHandlers
;
use
Wikimedia\Parsoid\DOM\Element
;
use
Wikimedia\Parsoid\DOM\Node
;
use
Wikimedia\Parsoid\Html2Wt\SerializerState
;
use
Wikimedia\Parsoid\Utils\DOMCompat
;
use
Wikimedia\Parsoid\Utils\DOMDataUtils
;
class
CaptionHandler
extends
DOMHandler
{
public
function
__construct
()
{
parent
::
__construct
(
false
);
}
/** @inheritDoc */
public
function
handle
(
Element
$node
,
SerializerState
$state
,
bool
$wrapperUnmodified
=
false
):
?
Node
{
$dp
=
DOMDataUtils
::
getDataParsoid
(
$node
);
// Serialize the tag itself
$tableTag
=
$this
->
serializeTableTag
(
$dp
->
startTagSrc
??
'|+'
,
null
,
$state
,
$node
,
$wrapperUnmodified
);
$state
->
emitChunk
(
$tableTag
,
$node
);
$state
->
serializeChildren
(
$node
);
return
$node
->
nextSibling
;
}
/** @inheritDoc */
public
function
before
(
Element
$node
,
Node
$otherNode
,
SerializerState
$state
):
array
{
return
(
DOMCompat
::
nodeName
(
$otherNode
)
!==
'table'
)
?
[
'min'
=>
1
,
'max'
=>
$this
->
maxNLsInTable
(
$node
,
$otherNode
)
]
:
[
'min'
=>
0
,
'max'
=>
$this
->
maxNLsInTable
(
$node
,
$otherNode
)
];
}
/** @inheritDoc */
public
function
after
(
Element
$node
,
Node
$otherNode
,
SerializerState
$state
):
array
{
return
[
'min'
=>
1
,
'max'
=>
$this
->
maxNLsInTable
(
$node
,
$otherNode
)
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 13:03 (40 m, 55 s ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a2/71/93bae0a349c2b0b98b838e66fa5d
Default Alt Text
CaptionHandler.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment