Commit 5545b6fa authored by Leo Gordon's avatar Leo Gordon
Browse files

bugfix: do not force whole-piece substitutions into string context

parent 68498508
......@@ -137,9 +137,14 @@ sub substitute {
my $self = shift @_;
my $ref = shift @_;
unless(my $ref_type = ref($$ref)) {
my $ref_type = ref($$ref);
$$ref =~ s{(?:#\:subst (.+?)\:#)}{$self->o(split(/->/,$1))}eg;
if(!$ref_type) {
if($$ref =~ /^#\:subst ([^:]+)\:#$/) { # if the given string is one complete substitution, we don't want to force the output into a string
$$ref = $self->o(split/->/,$1);
} else {
$$ref =~ s{(?:#\:subst (.+?)\:#)}{$self->o(split(/->/,$1))}eg;
}
} elsif($ref_type eq 'HASH') {
foreach my $value (values %$$ref) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment