From 5b688514c754fc7f91c676bc75e923f58f576b5c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 26 Aug 2025 14:43:59 -0400 Subject: [PATCH] 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 --- build-scripts/wikiheaders.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-scripts/wikiheaders.pl b/build-scripts/wikiheaders.pl index c2732af52e..4896a2e669 100755 --- a/build-scripts/wikiheaders.pl +++ b/build-scripts/wikiheaders.pl @@ -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;