<p> in tables
wisse e. (wisse@nlr.nl)
Tue, 16 Dec 1997 14:24:07 +0000
Hello all,
When parsing a html file with some unexpected changes are made to the html.
The following Perl script:
---------------------------------------
use HTML::TreeBuilder;
$doc = new HTML::TreeBuilder;
$doc->parse_file("test.html");
open(HTML,">testout.html");
print HTML $doc->as_HTML;
close(HTML);
---------------------------------------
Chops up tables when it finds <p> tags present in the table elements.
A <p> in the original html file results in a </table> element to be added
before the <p> element.
The following html:
---------------------------------------
<BODY><H1>This is the heading</H1>
<P ALIGN="center">This is the first paragraph which contains a
<A HREF="link.html">link</A> and an <IMG ALT="image" SRC="img.gif">.
<HR>
<TABLE>
<TR>
<TD> Eerste veld</TD>
<TD> Tweede veld</TD>
</TR>
<TR>
<TD> Zoveelste veld</TD>
<TD> Laatste veld<p>Met daarin een heel nieuwe paragraaf</TD>
</TR>
</TABLE>
<HR>
</BODY>
----------------------------------------
Results in the last paragraph to be kicked out of the table altogether.
I am not aware that <p> is forbidden inside tables. Is there any way to switch
this behaviour off?
Bye,
Edwin Wisse
--
-----------------------------------------------------------------------
Edwin Wisse wisse@nlr.nl