예제 #1
0
 /**
  * Parses an HTML fragment.
  * @param $text HTML text to parse
  * @param $context String name of context element to pretend parsing is in.
  * @param $builder Custom builder implementation
  * @return Parsed HTML as DOMDocument
  */
 public static function parseFragment($text, $context = null, $builder = null)
 {
     $tokenizer = new Tokenizer($text, $builder);
     $tokenizer->parseFragment($context);
     return $tokenizer->save();
 }