Bug 36845: Do not loop over the content attribute

We skip it.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 68e317bd0f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit aed7e08496)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2024-05-20 13:34:24 +02:00 committed by Lucas Gass
parent 5a704197af
commit ce48510c21

View file

@ -132,17 +132,16 @@ sub text_extract {
# value [tag=input], meta
my $tag;
$tag = lc($1) if $t =~ /^<(\S+)/s;
for my $a ('alt', 'content', 'title', 'value', 'label', 'placeholder', 'aria-label') {
for my $a ('alt', 'title', 'value', 'label', 'placeholder', 'aria-label') {
if ($attr->{$a}) {
next if $a eq 'label' && $tag ne 'optgroup';
next if $a eq 'content';
next if $a eq 'value' && ($tag ne 'input'
|| (ref $attr->{'type'} && $attr->{'type'}->[1] =~ /^(?:hidden|radio|checkbox)$/)); # FIXME
next if $tag eq 'meta';
my($key, $val, $val_orig, $order) = @{$attr->{$a}}; #FIXME
$val = TmplTokenizer::trim($val);
# for selected attributes replace '[%..%]' with '%s' globally
if ( $a =~ /title|value|alt|content|placeholder|aria-label/ ) {
if ( $a =~ /title|value|alt|placeholder|aria-label/ ) {
$val =~ s/\[\%.*?\%\]/\%s/g;
}
# save attribute text for translation