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

Finish HTMLDTD_ChildDef_Required.

Fix bug in HTML_Generator that resulted in attribute-less empty elements to have extra spaces in them.

Add whitespace designation to MF_Text.

git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@44 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-04-17 00:49:15 +00:00
parent 20c53d6017
commit 83f735ea7e
5 changed files with 199 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ class HTML_Generator
} elseif (is_a($token, 'MF_EmptyTag')) {
$attr = $this->generateAttributes($token->attributes);
return '<' . $token->name . ' ' . $attr . ' />';
return '<' . $token->name . ($attr ? ' ' : '') . $attr . ' />';
} elseif (is_a($token, 'MF_Text')) {
return htmlentities($token->data, ENT_COMPAT, 'UTF-8');