mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 19:38:14 +00:00
wikiheaders: Don't autolink things that are already linked.
This is a dirty hack, but it currently works for our purposes. We just refuse to link an eligible string (like, say...`SDL_shadercross`), if there's a '[' character right before it. This WILL NOT WORK if the string is in the middle of a link! For example, if you had `[please refer to SDL_shadercross](https://example.com/)`, this will still fail in the usual ways, but we're not building out a robust parser here at the moment, and this catches the most common problem. Fixes #13160. Fixes https://github.com/libsdl-org/sdlwiki/issues/752 Closes https://github.com/libsdl-org/sdlwiki/pull/725
This commit is contained in:
@@ -343,7 +343,7 @@ sub wikify_chunk {
|
||||
|
||||
# Convert obvious API things to wikilinks.
|
||||
if (defined $apiprefixregex) {
|
||||
$str =~ s/(\A|[^\/a-zA-Z0-9_])($apiprefixregex[a-zA-Z0-9_]+)/$1\[$2\]\($2\)/gms;
|
||||
$str =~ s/(\A|[^\/a-zA-Z0-9_\[])($apiprefixregex[a-zA-Z0-9_]+)/$1\[$2\]\($2\)/gms;
|
||||
}
|
||||
|
||||
$str = $codedstr . $str;
|
||||
|
Reference in New Issue
Block a user