rev 1961 - trunk/buscador/lib/Buscador

[prev] [thread] [next] [lurker] [Date index for 2005/02/25]

From: simon
Subject: rev 1961 - trunk/buscador/lib/Buscador
Date: 11:10 on 25 Feb 2005
Author: simon
Date: 2005-02-25 11:10:07 +0000 (Fri, 25 Feb 2005)
New Revision: 1961

Modified:
   trunk/buscador/lib/Buscador/Decorate.pm
Log:
Change to new UTF and HTML infrstructure


Modified: trunk/buscador/lib/Buscador/Decorate.pm
===================================================================
--- trunk/buscador/lib/Buscador/Decorate.pm	2005-02-25 11:03:48 UTC (rev 1960)
+++ trunk/buscador/lib/Buscador/Decorate.pm	2005-02-25 11:10:07 UTC (rev 1961)
@@ -40,16 +40,12 @@
 sub format_body {
     my $mail = shift;
 
-    # NOTE! this needs a lot of work 
-    my $ct = $mail->simple->header('Content-Type') || "";
-
     
-    return $mail->body if ($ct =~ m!text/html!i);
-    my $html = ($mail->html)[0];
+    my $html = ($mail->html)[0];    
     return Buscador::HTML::fix_cid($mail,$html->raw) if $html;
 
 
-    my $body = $mail->body;
+    my $body = $mail->utf8_body;
     my $decorator = Text::Decorator->new($body);
 
     my %seen;
@@ -73,7 +69,7 @@
     $decorator->add_filter("NamedEntity" => @names) if @names;
     $decorator->add_filter("Addresses" => @addresses) if @addresses;
 
-    $decorator->format_as("html");
+   $decorator->format_as("html")."</pre>";
     
 }
 

Generated at 16:00 on 25 Feb 2005 by mariachi 0.52