Forráskód Böngészése

wikiheaders: Trim whitespace from end of lines in section headers.

Ryan C. Gordon 1 hónapja
szülő
commit
b8187e2abd
1 módosított fájl, 8 hozzáadás és 6 törlés
  1. 8 6
      build-scripts/wikiheaders.pl

+ 8 - 6
build-scripts/wikiheaders.pl

@@ -825,21 +825,23 @@ sub print_big_ascii_string {
             die("Don't have a big ascii entry for '$ch'!\n") if not defined $rowsref;
             die("Don't have a big ascii entry for '$ch'!\n") if not defined $rowsref;
             my $row = @$rowsref[$rownum];
             my $row = @$rowsref[$rownum];
 
 
+            my $outstr = '';
             if ($lowascii) {
             if ($lowascii) {
                 my @x = split //, $row;
                 my @x = split //, $row;
                 foreach (@x) {
                 foreach (@x) {
-                    my $v = ($_ eq "\x{2588}") ? 'X' : ' ';
-                    print $fh $v;
+                    $outstr .= ($_ eq "\x{2588}") ? 'X' : ' ';
                 }
                 }
             } else {
             } else {
-                print $fh $row;
+                $outstr = $row;
             }
             }
 
 
             $charidx++;
             $charidx++;
-
-            if ($charidx < $charcount) {
-                print $fh " ";
+            if ($charidx == $charcount) {
+                $outstr =~ s/\s*\Z//;  # dump extra spaces at the end of the line.
+            } else {
+                $outstr .= ' ';   # space between glyphs.
             }
             }
+            print $fh $outstr;
         }
         }
         print $fh "\n";
         print $fh "\n";
     }
     }