# placeholder for all repeatable entries for index
- sub chk_eval($) {
- my $data = shift;
- return if (! defined($data));
- if ($data && $data =~ s/\s*eval{([^}]+)}\s*//) {
- if (eval "$1") {
- return $data;
- } else {
- return undef;
- }
- } else {
- return $data;
- }
- }
-
sub mkformat($$) {
my $x = shift || die "mkformat needs tag reference";
my $data = shift || return;
- my $format_name = x($x->{format_name}) || return chk_eval($data);
+ my $format_name = x($x->{format_name}) || return $data;
my $fmt = x($config->{format}->{$format_name}->{content}) || die "<format name=\"$format_name\"> is not defined!";
my $format_delimiter = x($x->{format_delimiter});
my @data;
if ($fmt) {
my $nr = scalar $fmt =~ s/%s/%s/g;
if (($#data+1) == $nr) {
- return chk_eval(sprintf($fmt,@data));
+ return sprintf($fmt,@data);
} else {
#print STDERR "mkformat: [$data] can't be split on [$format_delimiter] to $nr fields!\n";
- return chk_eval($data);
+ return $data;
}
} else {
print STDERR "usage of link '$format_name' without defined format (<link> tag)\n";
}
# type="swish" ; field for swish
if ($swish) {
- my $tmp;
+ my $tmp = $swish;
if ($filter && ($s || $se)) {
no strict 'refs';
- $tmp = join(" ",&$filter($swish)) if ($s || $se);
+ $tmp = join(" ",&$filter($tmp)) if ($s || $se);
}
- $tmp = chk_eval($tmp);
$swish_data .= $tmp if ($s && $tmp);
$swish_exact_data .= "xxbxx $tmp xxexx " if ($tmp && $tmp ne "" && $se);
}
no strict 'refs';
$idisplay = &$filter($idisplay);
}
- $idisplay = chk_eval($idisplay);
push @index_data, $idisplay if ($idisplay && !$iterate_by_page);
}