Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5980345
normalize.test.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
757 B
Referenced Files
None
Subscribers
None
normalize.test.php
View Options
<?php
// PORT-FIXME: Incomplete. Doesn't support CLI flags of the JS version
require_once
__DIR__
.
'/../vendor/autoload.php'
;
use
Wikimedia\Parsoid\Html2Wt\DOMNormalizer
;
use
Wikimedia\Parsoid\Mocks\MockEnv
;
use
Wikimedia\Parsoid\Utils\ContentUtils
;
use
Wikimedia\Parsoid\Utils\DOMCompat
;
$html
=
file_get_contents
(
$argv
[
1
]
);
$mockEnv
=
new
MockEnv
(
[]
);
$mockState
=
(
object
)[
"env"
=>
$mockEnv
,
"selserMode"
=>
true
];
$doc
=
ContentUtils
::
createAndLoadDocument
(
$html
,
[
"markNew"
=>
true
]
);
$body
=
DOMCompat
::
getBody
(
$doc
);
$norm
=
new
DOMNormalizer
(
$mockState
);
$norm
->
normalize
(
$body
);
$opts
=
[
'keepTmp'
=>
true
,
'storeDiffMark'
=>
true
,
];
print
ContentUtils
::
dumpDOM
(
$body
,
'DOM post-normalization'
,
$opts
);
print
"
\n
"
;
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 21:20 (1 w, 17 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
2b/89/9798d6392e742a41c54f32156ed7
Default Alt Text
normalize.test.php (757 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment