docs: put <> within backticks in titles

To render better markdown. Make managen warn if present "unticked" and
unescaped.

Closes #18498
This commit is contained in:
Daniel Stenberg 2025-09-08 17:29:56 +02:00
parent e3c06ccc66
commit 32909591d2
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 27 additions and 20 deletions

View file

@ -373,12 +373,19 @@ sub render {
}
elsif(/^## (.*)/) {
my $word = $1;
my $nontick = $word;
# if there are enclosing quotes, remove them first
$word =~ s/[\"\'](.*)[\"\']\z/$1/;
# remove backticks from headers
$word =~ s/\`//g;
# remove backticked sections
$nontick =~ s/\`[^\`]*\`//g;
if($nontick =~ /[^\\][\<\>]/) {
print STDERR "$f:$line:1:WARN: un-escaped < or > used: $nontick\n";
}
# if there is a space, it needs quotes for manpage
if(($word =~ / /) && $manpage) {
$word = "\"$word\"";