mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-21 05:26:03 +00:00
wikiheaders: Fix links in manpage generation.
Fixes #15665.
(cherry picked from commit 7134ed5c1c)
This commit is contained in:
parent
1de0c4e0f0
commit
76db4ee3e7
1 changed files with 15 additions and 2 deletions
|
|
@ -396,6 +396,19 @@ sub wikify {
|
|||
return $retval;
|
||||
}
|
||||
|
||||
sub gen_manpage_url {
|
||||
my $url = shift;
|
||||
my $desc = shift;
|
||||
|
||||
# We have to unmangle some mangling we just did. :/
|
||||
$url =~ s/\\\[char46\]/./g;
|
||||
|
||||
# can't have newlines in this.
|
||||
$desc =~ s/\n/ /g;
|
||||
|
||||
return "\n.URL \"$url\" \"$desc\"\n";
|
||||
}
|
||||
|
||||
|
||||
my $dewikify_mode = 'md';
|
||||
my $dewikify_manpage_code_indent = 1;
|
||||
|
|
@ -459,7 +472,7 @@ sub dewikify_chunk {
|
|||
}
|
||||
|
||||
# links
|
||||
$str =~ s/\[(https?\:\/\/.*?)\s+(.*?)\]/\n.URL "$1" "$2"\n/g;
|
||||
$str =~ s/\[(https?\:\/\/.*?)\s+(.*?)\]\s*/gen_manpage_url($1, $2)/ge;
|
||||
|
||||
# <code></code> is also popular. :/
|
||||
$str =~ s/\s*\<code>(.*?)<\/code>\s*/\n.BR $1\n/gms;
|
||||
|
|
@ -496,7 +509,7 @@ sub dewikify_chunk {
|
|||
}
|
||||
|
||||
# links
|
||||
$str =~ s/\[(.*?)]\((https?\:\/\/.*?)\)/\n.URL "$2" "$1"\n/g;
|
||||
$str =~ s/\[([^\]]*?)]\((https?\:\/\/.*?)\)\s*/gen_manpage_url($2, $1)/ge;
|
||||
|
||||
# <code></code> is also popular. :/
|
||||
$str =~ s/\s*(\S*?)\`([^\n]*?)\`(\S*)\s*/\n.BR "" "$1" "$2" "$3"\n/gms;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue