aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrf2
1 files changed, 2 insertions, 0 deletions
diff --git a/rf b/rf
index 0cf92a4..0d3fe67 100755
--- a/rf
+++ b/rf
@@ -169,6 +169,7 @@ sub fmt {
my $val = $ref{lc $fld};
$val = join '; ', @$val if lc $fld eq 'a';
$val = fmtl($val) if $fld eq 'A';
+ next if $fmt =~ s/\{([^{}%]*)%\Q$fld\E\|%[Aacdmnpqtwy]([^{}]*)}/$1$val$2/g;
if ($val =~ /[.,?!]$/) { # fix double punctuation
next if $fmt =~ s/\{([^{}%]*)%\Q$fld\E[.,?!]?([^{}]*)}/$1$val$2/g;
$fmt =~ s/%\Q$fld\E[.,?!]?/$val/g
@@ -178,6 +179,7 @@ sub fmt {
}
} else { # remove escape syntax after failed interpolation
no warnings;
+ next if $fmt =~ s/\{([^{}%]*)%\Q$fld\E\|(%[Aacdmnpqtwy])([^{}]*)}/$1$2$3/g;
next if $fmt =~ s/\{([^{}%]*)%\Q$fld\E([^{}]*)}[.,?!:;]?//g;
$fmt =~ s/%\Q$fld\E[.,?!:;]?//g;
}