From b8187e2abd4b7c34e23e7ad313e494cc3b134681 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Sun, 1 Jun 2025 10:43:08 -0400
Subject: [PATCH] wikiheaders: Trim whitespace from end of lines in section
headers.
---
build-scripts/wikiheaders.pl | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/build-scripts/wikiheaders.pl b/build-scripts/wikiheaders.pl
index 294666ffb5c15..220f13679b598 100755
--- a/build-scripts/wikiheaders.pl
+++ b/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;
my $row = @$rowsref[$rownum];
+ my $outstr = '';
if ($lowascii) {
my @x = split //, $row;
foreach (@x) {
- my $v = ($_ eq "\x{2588}") ? 'X' : ' ';
- print $fh $v;
+ $outstr .= ($_ eq "\x{2588}") ? 'X' : ' ';
}
} else {
- print $fh $row;
+ $outstr = $row;
}
$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";
}