Commit 7390bc0e5e19f9dfc92e1198a0add5e0f73604c7

Ryan C. Gordon 2021-07-14T09:36:07

wikiheaders.pl: Fix \sa tags that (incorrectly!) have "()" appended.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/build-scripts/wikiheaders.pl b/build-scripts/wikiheaders.pl
index c4019cb..80a15d3 100755
--- a/build-scripts/wikiheaders.pl
+++ b/build-scripts/wikiheaders.pl
@@ -611,6 +611,7 @@ if ($copy_direction == 1) {  # --copy-to-headers
             my @desclines = split /\n/, $v;
             foreach (@desclines) {
                 s/\A(\:|\* )//;
+                s/\(\)\Z//;  # Convert "SDL_Func()" to "SDL_Func"
                 $str .= "\\sa $_\n";
             }
         }
@@ -764,6 +765,7 @@ if ($copy_direction == 1) {  # --copy-to-headers
                 $sections{'Version'} = wordwrap($desc) . "\n";
             } elsif ($l =~ /\A\\sa\s+(.*)\Z/) {
                 my $sa = $1;
+                $sa =~ s/\(\)\Z//;  # Convert "SDL_Func()" to "SDL_Func"
                 $sections{'Related Functions'} = '' if not defined $sections{'Related Functions'};
                 if ($wikitype eq 'mediawiki') {
                     $sections{'Related Functions'} .= ":[[$sa]]\n";