mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-04 05:07:55 +02:00
Fix bug in HTML_Generator that resulted in extra spaces. PureHTMLDefinition now passes all tests.
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@34 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -3,10 +3,11 @@
|
||||
class PureHTMLDefinition
|
||||
{
|
||||
|
||||
var $generator;
|
||||
var $info = array();
|
||||
|
||||
function PureHTMLDefinition() {
|
||||
|
||||
$this->generator = new HTML_Generator();
|
||||
}
|
||||
|
||||
function loadData() {
|
||||
@@ -136,7 +137,10 @@ class PureHTMLDefinition
|
||||
$result = array();
|
||||
foreach($tokens as $token) {
|
||||
if (is_subclass_of($token, 'MF_Tag')) {
|
||||
if (!isset($this->info[$token->name])) continue;
|
||||
if (!isset($this->info[$token->name])) {
|
||||
// invalid tag, generate HTML and insert in
|
||||
$token = new MF_Text($this->generator->generateFromToken($token));
|
||||
}
|
||||
} elseif (is_a($token, 'MF_Comment')) {
|
||||
// strip comments
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user