mirror of
https://github.com/curl/curl.git
synced 2026-08-24 19:13:39 +03:00
managen: correct the warning for un-escaped '<' and '>'
1. make sure the check is done before the backticks are replaced 2. ignore less-than and greater-than used within backticks (adjust proxy.md that now showed a two-space warning) Closes #16315
This commit is contained in:
parent
92611f2a56
commit
c561c94ec3
2 changed files with 18 additions and 12 deletions
|
|
@ -391,6 +391,23 @@ sub render {
|
|||
$d =~ s/`%VERSION`/$version/g;
|
||||
$d =~ s/`%GLOBALS`/$globals/g;
|
||||
|
||||
if(!$quote) {
|
||||
if($d =~ /^(.*) /) {
|
||||
printf STDERR "$f:$line:%d:ERROR: 2 spaces detected\n",
|
||||
length($1);
|
||||
return 3;
|
||||
}
|
||||
my $back = $d;
|
||||
|
||||
# remove all backticked pieces
|
||||
$back =~ s/\`(.*?)\`//g;
|
||||
|
||||
if($back =~ /[^\\][\<\>]/) {
|
||||
print STDERR "$f:$line:1:WARN: un-escaped < or > used: $back\n";
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
# convert backticks to double quotes
|
||||
$d =~ s/\`/\"/g;
|
||||
|
||||
|
|
@ -410,17 +427,6 @@ sub render {
|
|||
}
|
||||
}
|
||||
|
||||
if(!$quote) {
|
||||
if($d =~ /^(.*) /) {
|
||||
printf STDERR "$f:$line:%d:ERROR: 2 spaces detected\n",
|
||||
length($1);
|
||||
return 3;
|
||||
}
|
||||
elsif($d =~ /[^\\][\<\>]/) {
|
||||
print STDERR "$f:$line:1:WARN: un-escaped < or > used\n";
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
# convert backslash-'<' or '> to just the second character
|
||||
$d =~ s/\\([><])/$1/g;
|
||||
# convert single backslash to double-backslash
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue