summaryrefslogtreecommitdiff
path: root/example.php
blob: ed0d86e33bb2204f1dc39847c4cfcae719534e1a (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>
  &amp; Nobody nowhere.
  </section>
  <test xmlns:foo="http://example.com/foo">TEST</test>
  <![CDATA[Because we can.]]>
  &copy;
  </body></html>
HERE;

$dom = \HTML5Helper::loadHTML($html);

print "Converting to HTML 5\n";

\HTML5Helper::save($dom, fopen("php://stdin", 'w'));