Do not print meta section for empty titles
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 14 Jan 2005 09:52:42 +0000 (09:52 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 14 Jan 2005 09:52:42 +0000 (09:52 +0000)
test/dmoz/con1.pl

index d2591c3..906eb27 100755 (executable)
@@ -2,7 +2,7 @@
 
 my $state = 'init';
 my $topic = '';
-my $title;
+my $title = '';
 my $description;
 
 while ($_ = <STDIN>) {
@@ -19,11 +19,14 @@ while ($_ = <STDIN>) {
        $description = $1;
     }
     elsif (/<\/ExternalPage>/) {
-       print "<meta>\n";
-       print " <title>$title</title>\n";
-       print " <description>$description</description>\n";
-       print " <url>$url</url>\n";
-       print " <topic>$topic</topic>\n";
-       print "</meta>\n";
+        if (length($title) > 0) 
+       {
+           print "<meta>\n";
+           print " <title>$title</title>\n";
+           print " <description>$description</description>\n";
+           print " <url>$url</url>\n";
+           print " <topic>$topic</topic>\n";
+           print "</meta>\n";
+       }
     }
 }