Mercurial > hg > cmmr2012-drupal-site
comparison vendor/masterminds/html5/example.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children | a9cd425dd02b |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c75dbcec494b |
---|---|
1 <?php | |
2 | |
3 require "vendor/autoload.php"; | |
4 use 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> | |
26 HERE; | |
27 | |
28 $html5 = new HTML5(); | |
29 $dom = $html5->loadHTML($html); | |
30 | |
31 print "Converting to HTML 5\n"; | |
32 | |
33 $html5->save($dom, fopen("php://stdin", 'w')); |