##
#!/usr/bin/perl
use strict;
use warnings;
use File::Copy;
use HTML::Strip;
use HTML::Entities;
sub convert_html;
convert_html("path/to/test.html");
sub convert_html($){
# NOTE: $pf contains the path as well as the filename excluding the extension.
# parse filename
$_[0] =~ /(.*)\.(.*)/;
my $pf = $1;
my $ext = $2;
# PREPARE FILES BEFORE RUNNING THE TAG STRIPPER
open (IN, "<:encoding(UTF-8)", "${pf}.${ext}");
open (OUT, ">:encoding(UTF-8)", "${pf}_htmlmod.${ext}");
while () {
s/\x{A0}/ /g; # remove non-breaking spaces
s/\n//g; # remove literal line breaks
s/<\/?p>/\n/ig; # conserve line breaks ("\/?" because " blabla
" is not caught by the normal regex
s/
/\n/ig; # yet more line breaks
s/\&\#8209;/-/g;
print OUT decode_entities($_);
# print OUT $_; # alternative attempt
}
close IN;
close OUT;
print "\nline break and nbsp preparation done\n";
;
# STRIP TAGS
# using :encoding(UTF-8) breaks this
open (IN, "<", "${pf}_htmlmod.${ext}");
open (OUT, ">", "${pf}.txt");
{
my $hs = HTML::Strip->new();
# my $hs = HTML::Strip->new( decode_entities => 1 ); # alternative attempt
while () {
my $clean_text = $hs->parse($_);
print OUT $clean_text;
}
close IN;
close OUT;
unlink "${pf}_htmlmod.${ext}";
}
print "\nhtml conversion done\n";
;
}
## ##
JACOBS
FŐTANÁCSNOK INDÍTVÁNYA<BRK>
Az ismertetés napja: 2005. november 17.1(1)
C‑371/03. sz. ügy
Siegfried Aulinger<BRK>
kontra<this should be left in>
Bundesrepublik Deutschland
1.<BRK> Ebben az ügyben az ‘Oberlandesgericht Köln’ (kölni fellebbviteli bíróság) a Szerb és a Montenegrói Köztársaság, valamint az
Európai Gazdasági Közösség közötti kereskedelem megtiltásáról szóló, 1992. június 1‑jei 1432/92/EGK tanácsi rendelet (a továbbiakban:
az embargóról szóló rendelet)(2) értelmezésére vonatkozóan két kérdést terjesztett a Bíróság elé előzetes döntéshozatalra.