0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-09-20 11:15:18 +00:00
htmlpurifier/Lexer.php
2006-07-22 12:53:04 +00:00

32 lines
664 B
PHP

<?php
/**
* Forgivingly lexes SGML style documents: HTML, XML, XHTML, etc.
*/
require_once 'HTMLPurifier/Token.php';
class HTMLPurifier_Lexer
{
function tokenizeHTML($string) {
trigger_error('Call to abstract class', E_USER_ERROR);
}
// we don't really care if it's a reference or a copy
function create($prototype = null) {
static $lexer = null;
if ($prototype) {
$lexer = $prototype;
}
if (empty($lexer)) {
require_once 'HTMLPurifier/Lexer/DirectLex.php';
$lexer = new HTMLPurifier_Lexer_DirectLex();
}
return $lexer;
}
}
?>