blob: c28e4c1c7dc72f1fc56be5d79dc521fa9d633d47 (
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
|
<?php
/**
* The main HTML5 front end.
*
* This class offers convenience methods for parsing and serializing HTML5.
*
* EXPERIMENTAL. This may change or be completely replaced.
*/
class HTML5 extends \HTML5\Parser {
// Inherit parse() and parseFragment().
/**
* Save a DOM into a given file as HTML5.
*/
public static function save($dom, $file) {
$serializer = new \HTML5\Serializer($dom);
return $serializer->save($file);
}
/**
* Convert a DOM into an HTML5 string.
*/
public static function saveHTML($dom) {
$serializer = new \HTML5\Serializer($dom);
return $serializer->saveHTML();
}
}
|