tidy-up: URLs (cont.) and mdlinkcheck

- add missing ending slashes.
  To avoid duplicates and to use canonical URLs.
- reapply lost updates.
  Follow-up to 2ae983bf4e #19879
- mdlinkcheck: include the `include` directory.
- mdlinkcheck: show unused whitelist items.
- mdlinkcheck: improve debug output.
- mdlinkcheck: delete redundant whitelist items.
- examples/simplessl: lowercase the protocol part.
- BINDINGS: replace one remaining HTTP URL with HTTPS.
  Issue: https://github.com/pycurl/pycurl/issues/892
- BINDINGS: fix a broken link.
- BINDINGS: follow a refresh content redirect.
- KNOWN_BUGS: whitespace.

Closes #19911
This commit is contained in:
Viktor Szakats 2025-12-09 21:24:28 +01:00
parent 00f06127ce
commit d9d2e339ce
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
16 changed files with 98 additions and 91 deletions

View file

@ -71,14 +71,12 @@ my %whitelist = (
'https://curl.se/rfc/rfc2255.txt' => 1,
'https://curl.se/sponsors.html' => 1,
'https://curl.se/support.html' => 1,
'https://curl.se/windows' => 1,
'https://curl.se/windows/' => 1,
'https://testclutch.curl.se/' => 1,
'https://github.com/curl/curl-fuzzer' => 1,
'https://github.com/curl/curl-www' => 1,
'https://github.com/curl/curl.git' => 1,
'https://github.com/curl/curl/wcurl' => 1,
);
@ -87,7 +85,7 @@ my %url;
my %flink;
# list all files to scan for links
my @files=`git ls-files docs src lib scripts`;
my @files=`git ls-files docs include lib scripts src`;
sub storelink {
my ($f, $line, $link) = @_;
@ -103,6 +101,7 @@ sub storelink {
if($link =~ /^(https|http):/) {
if($whitelist{$link}) {
#print "-- whitelisted: $link\n";
$whitelist{$link}++;
}
# example.com is just example
elsif($link =~ /^https:\/\/(.*)example.(com|org|net)/) {
@ -164,7 +163,7 @@ sub findlinks {
# comma, question mark, colon, closing parenthesis, backslash,
# closing angle bracket, whitespace, pipe, backtick, semicolon
elsif(/(https:\/\/[a-z0-9.\/:%_+@-]+[^."'*\#,?:\)> \t|`;\\])/i) {
#print "RAW ";
#print "RAW '$_'\n";
storelink($f, $line, $1);
}
$line++;
@ -202,10 +201,16 @@ for my $f (@files) {
}
}
#for my $u (sort keys %url) {
# print "$u\n";
#}
#exit;
for my $u (sort keys %whitelist) {
if($whitelist{$u} == 1) {
printf "warning: unused whitelist entry: '$u'\n";
}
}
for my $u (sort keys %url) {
print "$u\n";
}
exit;
my $error;
my @errlist;