# Halt recursive interpolation of story $body
# by mangling interpolation tags (to be unmangled in a moment)
unless ($recurse_into_story) {
- $blosxom::title =~ s/<(\@|\??\$)/<#INTERPOLATE_FANCY_DEFANG#$1/gsi;
- $blosxom::body =~ s/<(\@|\??\$)/<#INTERPOLATE_FANCY_DEFANG#$1/gsi;
+ $blosxom::title =~ s/<(\@|\??\$)/<#INTERPOLATE_FANCY_DEFANG#$1/gsi if defined $blosxom::title;
+ $blosxom::body =~ s/<(\@|\??\$)/<#INTERPOLATE_FANCY_DEFANG#$1/gsi if defined $blosxom::body;
}
my $template = shift;
# Variable expansion (unconditional, recursive)
#
# e.g. <$var />
- while( $template =~ s/<\$([a-zA-Z?]\w+(?:::\w+)*)\s+?\/>/"defined \$$1 ? \$$1 : undef"/gsee ) { }
+ while( $template =~ s/<\$([a-zA-Z?]\w+(?:::\w+)*)\s+?\/>/"defined \$$1 ? \$$1 : ''"/gsee ) { }
#
# Actions
sub _test {
my($variable, $attr) = @_;
+ # If the variable is not defined, treat it as the empty string in
+ # comparisons below
+ if (!defined $variable) {
+ $variable = '';
+ }
my $attributes = interpolate_fancy::_attributes($attr);
defined $attributes->{eq} and return $variable eq $attributes->{eq};