1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-10-16 06:26:08 +02:00

Standardize test-cases with the prefix Test_. Add framework for HTML_Purifier, its unit test will really only be for regression testing from integration issues. It's more important to test the components.

git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@35 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-04-16 03:39:39 +00:00
parent 69da034570
commit 1a3887de1b
5 changed files with 27 additions and 7 deletions

View File

@@ -3,7 +3,23 @@
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);
}
}