Fix check-docs to avoid false-positives on missing anchors.

Also add an anchor for the second ClientTranportPlugin instance.

See #40339.

This doesn't need a changes file because it isn't user-facing.
This commit is contained in:
Nick Mathewson
2022-06-16 11:50:59 -04:00
parent 1d6470a2a8
commit 6c1aad13e2
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -41,9 +41,16 @@ loadTorrc("@abs_top_srcdir@/src/config/torrc.sample.in", \%torrcSampleOptions);
my $considerNextLine = 0;
open(F, "@abs_top_srcdir@/doc/man/tor.1.txt") or die;
while (<F>) {
if (m!^(?:\[\[([A-za-z0-9_]+)\]\] *)?\*\*([A-Za-z0-9_]+)\*\*!) {
if (m!^(?:\[\[([A-za-z0-9_]+)\]\] *)?\*\*([A-Za-z0-9_]+)\*\*! && $considerNextLine) {
$manPageOptions{$2} = 1;
print "Missing an anchor: $2\n" unless (defined $1 or $2 eq 'tor');
$considerNextLine = 1;
} elsif (m!^\s*$! or
m!^\s*\+\s*$! or
m!^\s*//!) {
$considerNextLine = 1;
} else {
$considerNextLine = 0;
}
}
close F;