Skip to content

Commit a06b362

Browse files
committed
Improve link checker
Was ignoring a whole class of potential failures (caught by https://docs-dev.raku.org/error-report)
1 parent 23be70e commit a06b362

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

xt/rakudoc-l.rakutest

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ sub is-valid-link($links) {
8585
my $ok = ?($path.IO.d or ($path ~ '.rakudoc').IO.e);
8686
ok $ok, "$link exists (primary)";
8787
%bad-links{$link}++ unless $ok;
88+
} else {
89+
my @valid-protocols = <http https irc>;
90+
next if $link.starts-with: '#'; # don't check in-page anchors
91+
next if $link.starts-with(any(@valid-protocols) ~ '://');
92+
93+
%bad-links{$link}++;
94+
flunk("relative link or bad protocol: $link");
8895
}
8996
}
9097
}

0 commit comments

Comments
 (0)