Lines 132-148
sub text_extract {
Link Here
|
132 |
# value [tag=input], meta |
132 |
# value [tag=input], meta |
133 |
my $tag; |
133 |
my $tag; |
134 |
$tag = lc($1) if $t =~ /^<(\S+)/s; |
134 |
$tag = lc($1) if $t =~ /^<(\S+)/s; |
135 |
for my $a ('alt', 'content', 'title', 'value', 'label', 'placeholder', 'aria-label') { |
135 |
for my $a ('alt', 'title', 'value', 'label', 'placeholder', 'aria-label') { |
136 |
if ($attr->{$a}) { |
136 |
if ($attr->{$a}) { |
137 |
next if $a eq 'label' && $tag ne 'optgroup'; |
137 |
next if $a eq 'label' && $tag ne 'optgroup'; |
138 |
next if $a eq 'content'; |
|
|
139 |
next if $a eq 'value' && ($tag ne 'input' |
138 |
next if $a eq 'value' && ($tag ne 'input' |
140 |
|| (ref $attr->{'type'} && $attr->{'type'}->[1] =~ /^(?:hidden|radio|checkbox)$/)); # FIXME |
139 |
|| (ref $attr->{'type'} && $attr->{'type'}->[1] =~ /^(?:hidden|radio|checkbox)$/)); # FIXME |
141 |
next if $tag eq 'meta'; |
140 |
next if $tag eq 'meta'; |
142 |
my($key, $val, $val_orig, $order) = @{$attr->{$a}}; #FIXME |
141 |
my($key, $val, $val_orig, $order) = @{$attr->{$a}}; #FIXME |
143 |
$val = TmplTokenizer::trim($val); |
142 |
$val = TmplTokenizer::trim($val); |
144 |
# for selected attributes replace '[%..%]' with '%s' globally |
143 |
# for selected attributes replace '[%..%]' with '%s' globally |
145 |
if ( $a =~ /title|value|alt|content|placeholder|aria-label/ ) { |
144 |
if ( $a =~ /title|value|alt|placeholder|aria-label/ ) { |
146 |
$val =~ s/\[\%.*?\%\]/\%s/g; |
145 |
$val =~ s/\[\%.*?\%\]/\%s/g; |
147 |
} |
146 |
} |
148 |
# save attribute text for translation |
147 |
# save attribute text for translation |
149 |
- |
|
|