HTML5_Parser

Outwards facing interface for HTML5.

Defined (1)

The class is defined in the following location(s).

/lib/dompdf/lib/html5lib/Parser.php  
  1. class HTML5_Parser 
  2. /** 
  3. * Parses a full HTML document. 
  4. * @param $text HTML text to parse 
  5. * @param $builder Custom builder implementation 
  6. * @return Parsed HTML as DOMDocument 
  7. */ 
  8. static public function parse($text, $builder = null) { 
  9. $tokenizer = new HTML5_Tokenizer($text, $builder); 
  10. $tokenizer->parse(); 
  11. return $tokenizer->save(); 
  12. /** 
  13. * Parses an HTML fragment. 
  14. * @param $text HTML text to parse 
  15. * @param $context String name of context element to pretend parsing is in. 
  16. * @param $builder Custom builder implementation 
  17. * @return Parsed HTML as DOMDocument 
  18. */ 
  19. static public function parseFragment($text, $context = null, $builder = null) { 
  20. $tokenizer = new HTML5_Tokenizer($text, $builder); 
  21. $tokenizer->parseFragment($context); 
  22. return $tokenizer->save();