Re: Bug in Conversion?
Gisle Aas (aas@bergen.sn.no)
03 Jul 1997 06:51:23 +0000
"Benjamin M. Hill" <Benjamin.M.Hill@dartmouth.edu> writes:
> Is this a bug? Or a "feature?"
Try this patch:
Index: Formatter.pm
===================================================================
RCS file: /f/stovner/utvikling/CVSROOT/aas/perl/mods/libwww-perl/lib/HTML/Formatter.pm,v
retrieving revision 1.14
diff -u -r1.14 Formatter.pm
--- Formatter.pm 1997/04/05 12:38:00 1.14
+++ Formatter.pm 1997/07/03 06:49:37
@@ -242,7 +242,7 @@
{
my($self, $elem) = @_;
my $size = $elem->attr('size');
- return unless defined $size;
+ return 1 unless defined $size;
if ($size =~ /^\s*[+\-]/) {
my $base = $self->{basefont_size}[-1];
$size = $base + $size;
> Just wondering. I'm rather new to this, so if there is a way to do an option
> switch that will keep the words that got blanked out, I'd love to know.
> Thanks!
>
> Code to convert:
> $htmldata = HTML::Parse::parse_html($rawdata);
> $formatter = new HTML::FormatText;
> $textdata = $formatter->format($htmldata);
>
> Original HTML:
> <font size="2">Thu 03Jul97 05:30:30</font><br>
> <b><font color="darkred">Torched</font> to <font
> color="black">Bartender</font></b><br>
> <dl><dd>
> you there?<br>
>
>
> Output String:
> Thu 03Jul97 05:30:30
> to
>
> you there?
--
Gisle Aas <aas@sn.no>