From 2a9be2b2e65a8312d9335805242168c0bfccb6bd Mon Sep 17 00:00:00 2001 From: acli Date: Sat, 14 Feb 2004 09:50:11 +0000 Subject: [PATCH] Don't bother warning about TMPL_VAR if the key is onclick, onblur, etc. We don't know how to warn/what to suggest, & that will only confuse people --- misc/translator/text-extract2.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/misc/translator/text-extract2.pl b/misc/translator/text-extract2.pl index 1db71a07dd..3ace60bb20 100755 --- a/misc/translator/text-extract2.pl +++ b/misc/translator/text-extract2.pl @@ -107,12 +107,14 @@ sub extract_attributes ($;$) { warn "Warning: TMPL_INCLUDE in attribute" . (defined $lc? " near line $lc": '') . ": $val_orig\n"; } elsif ($val =~ /$re_tmpl_var/os && $val !~ /$re_tmpl_var_escaped/os) { - # FIXME: we probably should not warn if key is "onclick" etc? :-/ - my $suggest = ($key =~ /^(?:action|archive|background|cite|classid|codebase|data|datasrc|for|href|longdesc|profile|src|usemap)$/? 'URL': 'HTML'); + # XXX: we probably should not warn if key is "onclick" etc + # XXX: there's just no reasonable thing to suggest + my $suggest = ($key =~ /^(?:action|archive|background|cite|classid|codebase|data|datasrc|for|href|longdesc|profile|src|usemap)$/i? 'URL': 'HTML'); + undef $suggest if $key =~ /^(?:onblur|onchange|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onreset|onselect|onsubmit|onunload)$/i; warn_pedantic \$pedantic_tmpl_var_use_in_nonpedantic_mode_p, "Suggest ESCAPE=$suggest for TMPL_VAR in attribute \"$key\"" . (defined $lc? " near line $lc": '') . ": $val_orig" - if $pedantic_p || !$pedantic_tmpl_var_use_in_nonpedantic_mode_p; + if defined $suggest && ($pedantic_p || !$pedantic_tmpl_var_use_in_nonpedantic_mode_p); } elsif ($val_orig !~ /^['"]/) { my $t = $val; $t =~ s/$re_directive_control//os; warn_pedantic \$pedantic_attribute_error_in_nonpedantic_mode_p, -- 2.20.1