From 906bfbc3d6c28ca4b66beaddc2f6ce922dbd5044 Mon Sep 17 00:00:00 2001 From: acli Date: Thu, 12 Feb 2004 18:19:17 +0000 Subject: [PATCH] Warn about unquoted attribute values containing [^-\.a-zA-Z0-9] --- misc/translator/text-extract2.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/translator/text-extract2.pl b/misc/translator/text-extract2.pl index a50612eff0..26fad4cb60 100755 --- a/misc/translator/text-extract2.pl +++ b/misc/translator/text-extract2.pl @@ -34,6 +34,7 @@ sub re_tag ($) { my $etag = $compat? '>': '<>\/'; # See the file "subst.pl.test1" for how the following mess is derived # Unfortunately, inserting $re_directive's has made this even messier + # FIXME: The following is somehow wrong. Paul's 1st report shouldn't happen. q{(<\/?(?:|(?:"(?:} . $re_directive . q{|[^"])*"|'(?:} . $re_directive . q{|[^'])*'|--(?:[^-]|-[^-])*--|(?:} . $re_directive . q{|[^-"'} . $etag . q{]|-[^-]))+))([} . $etag . q{])(.*)}; } BEGIN { @@ -70,6 +71,9 @@ sub extract_attributes ($;$) { $i += 1; $attr{+lc($key)} = [$key, $val, $val_orig, $i]; $s = $rest; + warn "Warning: Attribute unquoted but needs quoting" + . (defined $lc? " in line $lc": '') . ": $val_orig\n" + if $val =~ /[^-\.A-Za-z0-9]/s && $val_orig !~ /^['"]/; } if ($s =~ /\S/s) { # should never happen warn "Warning: Strange attribute syntax" -- 2.39.2