Mercurial > hg > cmmr2012-drupal-site
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/masterminds/html5/example.php Thu Jul 05 14:24:15 2018 +0000 @@ -0,0 +1,33 @@ +<?php + +require "vendor/autoload.php"; +use Masterminds\HTML5; + + +$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; + +$html5 = new HTML5(); +$dom = $html5->loadHTML($html); + +print "Converting to HTML 5\n"; + +$html5->save($dom, fopen("php://stdin", 'w'));