#!/usr/bin/perl -w # htmlweg.pl - Entfernt HTML-Code aus Textdateien, beachtet aber bestimmte # - Formatierungen # Copyright (C) 2001 by Ingo Blechschmidt # Sam Jun 16 13:09:43 MEST 2001 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Ingo Blechschmidt # Arberstraße 5 # 86179 Augsburg # E-Mail: iblech@web.de, http://www.way.to/uselinux/ # Tel.: +49 / 821 882955 # # @html = ; open (OUT, "|grep -v table | grep -vw tr | grep -wv td | grep -vw th") || die "./htmlweg.pl: Kann keine Verbindung mit sort (ich meine grep) herstellen!"; foreach $h (@html) { $h =~ s//---------------- Bild --------------/g; # $h =~ s/
/\\n/g; $h =~ s/
//g; $h =~ s/ä/ä/g; $h =~ s/ö/ö/g; $h =~ s/ü/ü/g; $h =~ s/Ä/Ä/g; $h =~ s/Ü/Ü/g; $h =~ s/Ö/Ö/g; $h =~ s/ß/ß/g; $h =~ s/*<\/a>//g; $h =~ s///g; $h =~ s/<\/em>//g; $h =~ s/
    |<\/ol>|
      |<\/ul>|<\/li>//g; $h =~ s/
        |<\/ol>|
          |<\/ul>|<\/li>//g; $h =~ s/
        • /* /g; $h =~ s///g; $h =~ s/<.code><.span>//g; $h =~ s/
          //g;
            $h =~ s/<\/pre>//g;
            $h =~ s/"/"/g;
            $h =~ s///g;
            $h =~ s/<\/strong>//g;
            $h =~ s///g;
            $h =~ s/<\/i>//g;
            $h =~ s///g;
            $h =~ s/<\/u>//g;
            $h =~ s/>/>/g;
            $h =~ s/<// /s;
            $h =~ s/ / /g;
            $h =~ s/&/&/g;
            $h =~ s/<.+?>/ /s;
            print OUT $h;
          }
          
          close(OUT);