From 21403fd5cc762857dea33590a90bb62812f78beb Mon Sep 17 00:00:00 2001 From: acli Date: Thu, 12 Feb 2004 17:58:24 +0000 Subject: [PATCH] extract_attributes now knows what XML-style self-closing tags are --- misc/translator/text-extract2.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/translator/text-extract2.pl b/misc/translator/text-extract2.pl index 4fbcbb278f..a50612eff0 100755 --- a/misc/translator/text-extract2.pl +++ b/misc/translator/text-extract2.pl @@ -61,7 +61,9 @@ use vars qw( $cdata_mode_p $cdata_close ); sub extract_attributes ($;$) { my($s, $lc) = @_; my %attr; - $s = $1 if $s =~ /^<\S+(.*)\S$/s; # should be always true + $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]*)=)?('((?:$re_directive|[^'])*)'|"((?:$re_directive|[^"])*)"|(($re_directive|[^\s<>])+))/os;) { my($key, $val, $val_orig, $rest) = ($1, (defined $3? $3: defined $4? $4: $5), $2, $'); -- 2.20.1