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