#45611 [Opn->Bgs]: Tidy does not repair HTML correctly

From: Date: Sun, 27 Jul 2008 00:32:11 +0000
Subject: #45611 [Opn->Bgs]: Tidy does not repair HTML correctly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-127298@lists.php.net to get a copy of this message
ID: 45611 Updated by: jani@php.net Reported By: lwpku95 at gmail dot com -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: Windows XP PHP Version: 5.2.6 New Comment: This is actually bug in the (lib)Tidy itself: http://sourceforge.net/tracker/index.php?func=detail&aid=2026039&group_id=27659&atid=390963 Previous Comments: ------------------------------------------------------------------------ [2008-07-23 20:05:47] lwpku95 at gmail dot com 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 this bug report at http://bugs.php.net/?id=45611&edit=1

« previous php.bugs (#127298) next »