Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1431979
StyleTag.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1018 B
Referenced Files
None
Subscribers
None
StyleTag.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Wikimedia\Parsoid\ParserTests
;
use
Wikimedia\Parsoid\Core\Sanitizer
;
use
Wikimedia\Parsoid\DOM\DocumentFragment
;
use
Wikimedia\Parsoid\Ext\ExtensionModule
;
use
Wikimedia\Parsoid\Ext\ExtensionTagHandler
;
use
Wikimedia\Parsoid\Ext\ParsoidExtensionAPI
;
use
Wikimedia\Parsoid\Utils\DOMCompat
;
class
StyleTag
extends
ExtensionTagHandler
implements
ExtensionModule
{
/** @inheritDoc */
public
function
sourceToDom
(
ParsoidExtensionAPI
$extApi
,
string
$content
,
array
$args
):
DocumentFragment
{
$domFragment
=
$extApi
->
htmlToDom
(
''
);
$style
=
$domFragment
->
ownerDocument
->
createElement
(
'style'
);
DOMCompat
::
setInnerHTML
(
$style
,
$content
);
Sanitizer
::
applySanitizedArgs
(
$extApi
->
getSiteConfig
(),
$style
,
$args
);
$domFragment
->
appendChild
(
$style
);
return
$domFragment
;
}
/** @inheritDoc */
public
function
getConfig
():
array
{
return
[
'name'
=>
'StyleTag'
,
'tags'
=>
[
[
'name'
=>
'style'
,
'handler'
=>
self
::
class
],
],
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 21:17 (1 d, 12 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
56/03/690f8bfe29246e04925a06ba90a1
Default Alt Text
StyleTag.php (1018 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment