--- a/scripts/topic-diff.pl
+++ b/scripts/topic-diff.pl
@@ -30,8 +30,10 @@
 #    $server->print ($channel, $server->{tag});
 
     if ($topics{$server->{tag}."_".$channel}) {
-	my @original = split /\s*\|\s*/, $topics{$server->{tag}."_".$channel};
-	my @modified = split /\s*\|\s*/, $topic;
+	$topics{$server->{tag}."_".$channel} =~ s/^ +| +$//g;
+	$topic =~ s/^ +| +$//g;
+	my @original = split /\s*\|\s*|\s+-\s+/, $topics{$server->{tag}."_".$channel};
+	my @modified = split /\s*\|\s*|\s+-\s+/, $topic;
 	
 	
       outer: while( $i <= $#original) {
