remove gallery-tags
This commit is contained in:
parent
bce4eccea5
commit
a699b94537
1 changed files with 6 additions and 1 deletions
7
wiki2.pl
7
wiki2.pl
|
@ -46,6 +46,7 @@ if (defined $result) {
|
||||||
my $isDis = 0;
|
my $isDis = 0;
|
||||||
my $ln = 0;
|
my $ln = 0;
|
||||||
my $comment = 0;
|
my $comment = 0;
|
||||||
|
my $gallery = 0;
|
||||||
foreach my $line (@lines) {
|
foreach my $line (@lines) {
|
||||||
#print "$line\n";
|
#print "$line\n";
|
||||||
$line =~ s/<!--.*-->//g;
|
$line =~ s/<!--.*-->//g;
|
||||||
|
@ -55,6 +56,8 @@ if (defined $result) {
|
||||||
$line=~ s/\s*$//;
|
$line=~ s/\s*$//;
|
||||||
$comment = 1 if $line =~ m/^<!--$/;
|
$comment = 1 if $line =~ m/^<!--$/;
|
||||||
$comment = 0 if $line =~ m/^-->$/;
|
$comment = 0 if $line =~ m/^-->$/;
|
||||||
|
$gallery = 1 if $line =~ m/^<gallery[^>]*>$/;
|
||||||
|
$gallery = 0 if $line =~ m/^<\/gallery>$/;
|
||||||
if ($line && $line =~ m/^\*\s?/ && $ln < 4) {
|
if ($line && $line =~ m/^\*\s?/ && $ln < 4) {
|
||||||
push(@newlines, $newline);
|
push(@newlines, $newline);
|
||||||
push(@newlines, $line);
|
push(@newlines, $line);
|
||||||
|
@ -64,6 +67,7 @@ if (defined $result) {
|
||||||
$newline = "$newline$line ";
|
$newline = "$newline$line ";
|
||||||
$ln++;
|
$ln++;
|
||||||
} elsif ($comment) {
|
} elsif ($comment) {
|
||||||
|
} elsif ($gallery) {
|
||||||
} else {
|
} else {
|
||||||
push(@newlines, $newline);
|
push(@newlines, $newline);
|
||||||
$newline = "";
|
$newline = "";
|
||||||
|
@ -74,7 +78,8 @@ if (defined $result) {
|
||||||
my $lst = 0;
|
my $lst = 0;
|
||||||
foreach my $line (@newlines) {
|
foreach my $line (@newlines) {
|
||||||
#print "$line\n";
|
#print "$line\n";
|
||||||
$line =~ s/<!--.*-->//g;
|
$line=~ s/<!--.*-->//g;
|
||||||
|
$line=~ s/<gallery[^>]*>[^<]*<\/gallery>//g;
|
||||||
$line=~ s/^[^}{]*}}//g;
|
$line=~ s/^[^}{]*}}//g;
|
||||||
$line=~ s/^{{Infobox.*}}//g;
|
$line=~ s/^{{Infobox.*}}//g;
|
||||||
$line=~ s/^[^\[]*\]\]//g;
|
$line=~ s/^[^\[]*\]\]//g;
|
||||||
|
|
Loading…
Reference in a new issue