blob: 2694aa45705600f1ca14c5fb2dfdcd42c2e0351c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
<?php
require "vendor/autoload.php";
$html = <<< 'HERE'
<html>
<head>
<title>TEST</title>
<script language="javascript">
if (2 > 1) { alert("Math wins."); }
</script>
</head>
<body id='foo'>
<!-- This space intentionally left blank. -->
<section class="section-a pretty" id="bar1">
<h1>Hello World</h1><p>This is a test of the HTML5 parser.</p>
<hr>
& Nobody nowhere.
</section>
<test xmlns:foo="http://example.com/foo">TEST</test>
<![CDATA[Because we can.]]>
©
</body></html>
HERE;
$dom = \HTML5::loadHTML($html);
print "Converting to HTML 5\n";
\HTML5::save($dom, fopen("php://stdin", 'w'));
|