1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 03:10:09 +02:00

[2.1.2] Implement experimental HTML5 parsing using PH5P

- Fix debugger so that tokens can be printed without an index
- Fix some broken PEAR unit tests

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1383 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-08-19 18:49:35 +00:00
parent 423afedbf4
commit cb92a57e4e
7 changed files with 4014 additions and 26 deletions

View File

@@ -54,14 +54,14 @@ function isInScopes($array = array()) {
}
/**#@-*/
function printTokens($tokens, $index) {
function printTokens($tokens, $index = null) {
$string = '<pre>';
$generator = new HTMLPurifier_Generator();
foreach ($tokens as $i => $token) {
if ($index == $i) $string .= '[<strong>';
if ($index === $i) $string .= '[<strong>';
$string .= "<sup>$i</sup>";
$string .= $generator->escape($generator->generateFromToken($token));
if ($index == $i) $string .= '</strong>]';
if ($index === $i) $string .= '</strong>]';
}
$string .= '</pre>';
echo $string;