mirror of
https://github.com/curl/curl.git
synced 2026-07-24 12:27:16 +03:00
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:
parent
e3c06ccc66
commit
32909591d2
3 changed files with 27 additions and 20 deletions
|
|
@ -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\"";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue