Skip to content

Commit b8187e2

Browse files
committed
wikiheaders: Trim whitespace from end of lines in section headers.
1 parent 9e0d9f3 commit b8187e2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

build-scripts/wikiheaders.pl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -825,21 +825,23 @@ sub print_big_ascii_string {
825825
die("Don't have a big ascii entry for '$ch'!\n") if not defined $rowsref;
826826
my $row = @$rowsref[$rownum];
827827

828+
my $outstr = '';
828829
if ($lowascii) {
829830
my @x = split //, $row;
830831
foreach (@x) {
831-
my $v = ($_ eq "\x{2588}") ? 'X' : ' ';
832-
print $fh $v;
832+
$outstr .= ($_ eq "\x{2588}") ? 'X' : ' ';
833833
}
834834
} else {
835-
print $fh $row;
835+
$outstr = $row;
836836
}
837837

838838
$charidx++;
839-
840-
if ($charidx < $charcount) {
841-
print $fh " ";
839+
if ($charidx == $charcount) {
840+
$outstr =~ s/\s*\Z//; # dump extra spaces at the end of the line.
841+
} else {
842+
$outstr .= ' '; # space between glyphs.
842843
}
844+
print $fh $outstr;
843845
}
844846
print $fh "\n";
845847
}

0 commit comments

Comments
 (0)