From 93740ec7ba69a4a34f8a56e4777aad9f9ed4ad41 Mon Sep 17 00:00:00 2001 From: acli Date: Sat, 14 Feb 2004 05:46:38 +0000 Subject: [PATCH] Make sure that if an attribute contains < or >, a warning is given; these warnings aren't pedantic because (1) if it's a templating directive, it might expand into something containing a real < and/or >, and (2) if it contains >, the browser will close the current tag, and (3) if it contains < and the browser knows what "SGML closed start tags" are (e.g., Mozilla), the browser will also close the current tag. --- misc/translator/text-extract2.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/misc/translator/text-extract2.pl b/misc/translator/text-extract2.pl index 77472f76f3..803d60451d 100755 --- a/misc/translator/text-extract2.pl +++ b/misc/translator/text-extract2.pl @@ -82,8 +82,10 @@ sub extract_attributes ($;$) { $s = $rest; warn "Warning: Attribute should be quoted" . (defined $lc? " near line $lc": '') . ": $val_orig\n" - if $pedantic_p - && $val =~ /[^-\.A-Za-z0-9]/s && $val_orig !~ /^['"]/; + if $val_orig !~ /^['"]/ && ( + ($pedantic_p && $val =~ /[^-\.A-Za-z0-9]/s) + || $val =~ /[<>]/s # this covers $re_directive, too + ) } if ($s =~ /\S/s) { # should never happen if ($s =~ /^([^\n]*)\n/s) { # this is even worse -- 2.39.5