|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-07-27 00:32 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 07:00:01 2025 UTC |
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>