summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2014-12-05 11:02:14 +0100
committerlookshe <github@lookshe.org>2014-12-05 11:02:14 +0100
commita699b945372a26ddcd97823a49d28a12f6f3a25a (patch)
tree2be462f7f6a6e4b2d3e42415980bf69a92481f93
parentbce4eccea562efc4d8e4203ce40c51406f57ad10 (diff)
remove gallery-tags
-rw-r--r--wiki2.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/wiki2.pl b/wiki2.pl
index c617b88..cacc46d 100644
--- a/wiki2.pl
+++ b/wiki2.pl
@@ -46,6 +46,7 @@ if (defined $result) {
my $isDis = 0;
my $ln = 0;
my $comment = 0;
+ my $gallery = 0;
foreach my $line (@lines) {
#print "$line\n";
$line =~ s/<!--.*-->//g;
@@ -55,6 +56,8 @@ if (defined $result) {
$line=~ s/\s*$//;
$comment = 1 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) {
push(@newlines, $newline);
push(@newlines, $line);
@@ -64,6 +67,7 @@ if (defined $result) {
$newline = "$newline$line ";
$ln++;
} elsif ($comment) {
+ } elsif ($gallery) {
} else {
push(@newlines, $newline);
$newline = "";
@@ -74,7 +78,8 @@ if (defined $result) {
my $lst = 0;
foreach my $line (@newlines) {
#print "$line\n";
- $line =~ s/<!--.*-->//g;
+ $line=~ s/<!--.*-->//g;
+ $line=~ s/<gallery[^>]*>[^<]*<\/gallery>//g;
$line=~ s/^[^}{]*}}//g;
$line=~ s/^{{Infobox.*}}//g;
$line=~ s/^[^\[]*\]\]//g;