#45611 [NEW]: Tidy can't correctly repare HTML
From: lwpku95 at gmail dot com
Operating system: Windows XP
PHP version: 5.2.6
PHP Bug Type: Unknown/Other Function
Bug description: Tidy can't correctly repare HTML
Description:
------------
Tried to use tidy to repair a HTML string. But the result is not correct.
Reproduce code:
---------------
<?php
$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head> <meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type"><title></title></head>
<body><table style="text-align: left; width: 100%;" border="1"
cellpadding="2" cellspacing="2">
<tr>
Cell 1</td><td>Cell 2</td> <td>Cell 3
</tr>
</table>
<br>
</body>
</html>';
$config = array('indent' => true);
$tidy = new tidy;
$tidy->parseString($html, $config);
$tidy->cleanRepair();
echo $tidy;
?>
Expected result:
----------------
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=us-ascii" http-equiv=
"content-type">
<title></title>
</head>
<body>
<table style="text-align: left; width: 100%;" border="1"
cellpadding="2" cellspacing="2">
<tr>
<td>
Cell 1
</td>
<td>
Cell 2
</td>
<td>
Cell 3
</td>
</tr>
</table><br>
</body>
</html>
Actual result:
--------------
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=us-ascii" http-equiv=
"content-type">
<title></title>
</head>
<body>
Cell 1
<table style="text-align: left; width: 100%;" border="1"
cellpadding="2" cellspacing="2">
<tr>
<td>
Cell 2
</td>
<td>
Cell 3
</td>
</tr>
</table><br>
</body>
</html>
--
Edit bug report at http://bugs.php.net/?id=45611&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45611&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45611&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45611&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45611&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45611&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45611&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45611&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45611&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45611&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45611&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45611&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45611&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45611&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45611&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45611&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45611&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45611&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45611&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45611&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45611&r=mysqlcfg
Thread (2 messages)
- lwpku95 at gmail dot com