0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-22 16:31:53 +00:00
htmlpurifier/HTML_Purifier.php

26 lines
545 B
PHP

<?php
class HTML_Purifier
{
var $lexer;
var $definition;
var $generator;
function HTML_Purifier() {
$this->lexer = new HTML_Lexer();
$this->definition = new PureHTMLDefinition();
$this->generator = new HTML_Generator();
}
function purify($html) {
$tokens = $this->lexer->tokenizeHTML($html);
$tokens = $this->definition->purifyTokens($tokens);
return $this->generator->generateFromTokens($tokens);
}
}
?>