#!/usr/bin/perl
# Adaptiert von Grisus heise.pl

use strict;
use diagnostics;

my $flag = 0;
my $mednewstext="";
my $mednewstext2="";

while (<>) {
    chomp;
    if ( ! $flag ) {
	if ( /<!--mark demarcation2-->/ ) {
	    $flag = 1;
        }
    }
    if ( $flag ) {
	if ( /<!--end demarcation-->/ || /<TD valign=top width=210 align=right >/ ) {
	    $flag = 0;
	} else {
	    if ( $flag > 1 ) {
               $mednewstext .= "$_\n";
	    }
	    if ( ?</B></FONT></TD>? ) {
	       $flag = 2 ;
	       ?([^>]*)</B></FONT></TD>? ;
	       $mednewstext .= "$1\n<p align=\"center\">***</p>\n";
	    }
	}
    }
}

print "<html><body>" . $mednewstext . "</body></html>\n";
