wikiheaders: regex hack to make a URL not confuse wikilink genertion.

This commit is contained in:
Ryan C. Gordon 2024-10-04 15:33:41 -04:00
parent a7e4e9219a
commit ffe4e571d1
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
2 changed files with 4 additions and 6 deletions

View File

@ -276,14 +276,14 @@ sub wikify_chunk {
$codedstr .= wikify_chunk($wikitype, $1, undef, undef); $codedstr .= wikify_chunk($wikitype, $1, undef, undef);
if (defined $apiprefixregex) { if (defined $apiprefixregex) {
# Convert obvious API things to wikilinks, even inside `code` blocks. # Convert obvious API things to wikilinks, even inside `code` blocks.
$codeblock =~ s/\b($apiprefixregex[a-zA-Z0-9_]+)/[[$1]]/gms; $codeblock =~ s/(\A|[^\/a-zA-Z0-9_])($apiprefixregex[a-zA-Z0-9_]+)/$1\[\[$2\]\]/gms;
} }
$codedstr .= "<code>$codeblock</code>"; $codedstr .= "<code>$codeblock</code>";
} }
# Convert obvious API things to wikilinks. # Convert obvious API things to wikilinks.
if (defined $apiprefixregex) { if (defined $apiprefixregex) {
$str =~ s/\b($apiprefixregex[a-zA-Z0-9_]+)/[[$1]]/gms; $str =~ s/(\A|[^\/a-zA-Z0-9_])($apiprefixregex[a-zA-Z0-9_]+)/$1\[\[$2\]\]/gms;
} }
# Make some Markdown things into MediaWiki... # Make some Markdown things into MediaWiki...
@ -328,7 +328,7 @@ sub wikify_chunk {
# Convert obvious API things to wikilinks. # Convert obvious API things to wikilinks.
if (defined $apiprefixregex) { if (defined $apiprefixregex) {
$str =~ s/\b($apiprefixregex[a-zA-Z0-9_]+)/[$1]($1)/gms; $str =~ s/(\A|[^\/a-zA-Z0-9_])($apiprefixregex[a-zA-Z0-9_]+)/$1\[$2\]\($2\)/gms;
} }
$str = $codedstr . $str; $str = $codedstr . $str;

View File

@ -147,9 +147,7 @@
* limited hardware support, this API is probably not for you. * limited hardware support, this API is probably not for you.
* *
* Examples demonstrating proper usage of this API can be found * Examples demonstrating proper usage of this API can be found
* [here](https://github.com/TheSpydog/SDL_gpu_examples * [here](https://github.com/TheSpydog/SDL_gpu_examples).
* )
* .
*/ */
#ifndef SDL_gpu_h_ #ifndef SDL_gpu_h_