From 1b95b1698e91dedefa208e47e06ab380d886cbcb Mon Sep 17 00:00:00 2001 From: acli Date: Sat, 14 Feb 2004 07:49:37 +0000 Subject: [PATCH] Fixed problem recognizing tags in the form of > --- misc/translator/text-extract2.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/misc/translator/text-extract2.pl b/misc/translator/text-extract2.pl index a6bce1de1b..b3652efd01 100755 --- a/misc/translator/text-extract2.pl +++ b/misc/translator/text-extract2.pl @@ -52,9 +52,11 @@ use vars qw( $re_tag_strict $re_tag_compat @re_tag ); sub re_tag ($) { my($compat) = @_; 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 - q{(<\/?(?:|(?:"(?:} . $re_directive . q{|[^"])*"|'(?:} . $re_directive . q{|[^'])*'|--(?:[^-]|-[^-])*--|(?:} . $re_directive . q{|[^-"'} . $etag . q{]|-[^-]))+))([} . $etag . q{])(.*)}; + # This is no longer similar to the original regexp in subst.pl :-( + # Note that we don't want <> in compat mode; Mozilla knows about < + q{(<\/?(?:|(?:"(?:} . $re_directive . q{|[^"])*"|'(?:} . $re_directive . q{|[^'])*'|--(?:[^-]|-[^-])*--|(?:} + . $re_directive + . q{|(?!--)[^"'<>} . $etag . q{]))+))([} . $etag . q{])(.*)}; } BEGIN { $re_comment = '(?:--(?:[^-]|-[^-])*--)'; @@ -97,7 +99,7 @@ sub extract_attributes ($;$) { $s = $1 if $s =~ /^<\S+(.*)\/\S$/s # XML-style self-closing tags || $s =~ /^<\S+(.*)\S$/s; # SGML-style tags - for (my $i = 0; $s =~ /^\s+(?:([a-zA-Z][-a-zA-Z0-9]*)\s*=\s*)?('((?:$re_directive|[^'])*)'|"((?:$re_directive|[^"])*)"|(($re_directive|[^\s<>])+))/os;) { + for (my $i = 0; $s =~ /^\s+(?:([a-zA-Z][-a-zA-Z0-9]*)\s*=\s*)?('((?:$re_directive|[^'])*)'|"((?:$re_directive|[^"])*)"|((?:$re_directive|[^\s<>])+))/os;) { my($key, $val, $val_orig, $rest) = ($1, (defined $3? $3: defined $4? $4: $5), $2, $'); $i += 1; -- 2.39.5