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

main
Ryan C. Gordon 2021-07-14 09:36:07 -04:00
parent d115857c6f
commit 7390bc0e5e
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
1 changed files with 2 additions and 0 deletions

View File

@ -611,6 +611,7 @@ if ($copy_direction == 1) { # --copy-to-headers
my @desclines = split /\n/, $v; my @desclines = split /\n/, $v;
foreach (@desclines) { foreach (@desclines) {
s/\A(\:|\* )//; s/\A(\:|\* )//;
s/\(\)\Z//; # Convert "SDL_Func()" to "SDL_Func"
$str .= "\\sa $_\n"; $str .= "\\sa $_\n";
} }
} }
@ -764,6 +765,7 @@ if ($copy_direction == 1) { # --copy-to-headers
$sections{'Version'} = wordwrap($desc) . "\n"; $sections{'Version'} = wordwrap($desc) . "\n";
} elsif ($l =~ /\A\\sa\s+(.*)\Z/) { } elsif ($l =~ /\A\\sa\s+(.*)\Z/) {
my $sa = $1; my $sa = $1;
$sa =~ s/\(\)\Z//; # Convert "SDL_Func()" to "SDL_Func"
$sections{'Related Functions'} = '' if not defined $sections{'Related Functions'}; $sections{'Related Functions'} = '' if not defined $sections{'Related Functions'};
if ($wikitype eq 'mediawiki') { if ($wikitype eq 'mediawiki') {
$sections{'Related Functions'} .= ":[[$sa]]\n"; $sections{'Related Functions'} .= ":[[$sa]]\n";