trs80 has asked for the wisdom of the Perl Monks concerning the following question:
Turns into:<html> <head> </head> <body> <table> <tr> <center> <td> </td> </center> </tr> </table> </body> <html>
The stray <center> tag gets turned into a an extra <td> tag.<html><head> </head><body> <table> <tr> <td><center> </center></td> <td> </td> </tr> </table> </body> </html>
use strict; my $html; while (<DATA>) { $html .= $_; } my $tree = HTML::TreeBuilder->new(); $tree->parse($html); print $tree->as_HTML(); __DATA__ <html> <head> </head> <body> <table> <tr> <center> <td> </td> </center> </tr> </table> </body> <html>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Keeping bad HTML bad
by fruiture (Curate) on Aug 23, 2002 at 20:32 UTC | |
by trs80 (Priest) on Aug 23, 2002 at 20:52 UTC | |
by Abstraction (Friar) on Aug 23, 2002 at 21:10 UTC | |
by trs80 (Priest) on Aug 23, 2002 at 21:26 UTC | |
|
Re: Keeping bad HTML bad
by ducky (Scribe) on Aug 23, 2002 at 23:40 UTC | |
|
Re: Keeping bad HTML bad
by Anonymous Monk on Aug 24, 2002 at 01:21 UTC | |
|
Re: Keeping bad HTML bad
by trs80 (Priest) on Aug 24, 2002 at 16:52 UTC | |
|
Re: Keeping bad HTML bad
by adrianh (Chancellor) on Aug 24, 2002 at 20:35 UTC | |
by trs80 (Priest) on Aug 24, 2002 at 21:37 UTC |