mhonarc-users

Patch to add start-of-message-body meta information

1996-04-29 16:41:45
Hi,

The patch below adds HTML comments to the msg*.html files:

        <!--X-Body-of-Message--> before the HTML markup of the original
        message body.

        <!--X-MsgBody--> and <!--X-MsgBody-End--> tags are now also
        added to messages that are converted with -single

This allows a search engine to restrict the range to the message body.
Therefore ignoring the message headers and footer added by mhonarc.

The patch does not add the <!--X-From: ... -->, <!--X-Date: ... -->
and <!--X-Subject: ... --> comments to messages that are converted 
with -single because this could be done/changed via resource files.

Btw. does somebody know how to parse (ignoring the time zone is okay)
 
   <!--X-Date:  Mon, 29 Apr 1996 20:38:50 +0200  -->

as a date field using freewais-sfs' waisindex?

  region: /^<!--X-Date:/ /^<!--X-Date: *[^,]* */
  datehead "Date Header" <date> /%d %3s %d/ day month string year TEXT LOCAL
  end: /-->/

does not work :-(

Achim

*** 1.1 1996/04/22 19:58:37
--- mhonarc     1996/04/25 21:02:43
***************
*** 1025,1037 ****
      $template =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge;
      print STDOUT $template;
  
      print STDOUT "<H1>$sub</H1>\n",
                 "<HR>\n",
                 $mhead;
  
      print STDOUT "<HR>\n"  unless $mhead =~ /^\s*$/;
      print STDOUT $mesg,
!                "<HR>\n";
  
      $template = $MSGFOOT;
      $template =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge;
--- 1025,1039 ----
      $template =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge;
      print STDOUT $template;
  
+     print STDOUT "<!--X-MsgBody-->";
      print STDOUT "<H1>$sub</H1>\n",
                 "<HR>\n",
                 $mhead;
  
      print STDOUT "<HR>\n"  unless $mhead =~ /^\s*$/;
+     print STDOUT "<!--X-Body-of-Message-->";
      print STDOUT $mesg,
!                "<!--X-MsgBody-End-->\n<HR>\n";
  
      $template = $MSGFOOT;
      $template =~ s/\$([^\$]*)\$/&replace_li_var($1)/ge;
***************
*** 1475,1480 ****
--- 1477,1484 ----
        }
  
        print MSGFILE $MsgHead{$index};
+       print MSGFILE "<!--X-Body-of-Message-->\n"; # mark start of message
+                                                   # body. Used for indexing
        print MSGFILE $Message{$index};
        print MSGFILE "<!--X-MsgBody-End-->\n";
      }
<Prev in Thread] Current Thread [Next in Thread>
  • Patch to add start-of-message-body meta information, Achim Bohnet <=