aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2020-12-01 00:15:19 +0100
committerJohn Ankarström <john@ankarstrom.se>2020-12-01 00:15:19 +0100
commit1511fba8e989df3dcdb4f6253e6c696a2e1944b7 (patch)
tree4bf5cb3695985e69b51f24cdbaf459364bc41d36
parentb44b23f79590d2bd9874985a253f247f33d03b20 (diff)
downloadmht-1511fba8e989df3dcdb4f6253e6c696a2e1944b7.tar.gz
Fix closing tag not being interpolated
-rwxr-xr-xmh14
1 files changed, 4 insertions, 10 deletions
diff --git a/mh b/mh
index cae73bf..070c121 100755
--- a/mh
+++ b/mh
@@ -12,7 +12,7 @@ use Text::ParseWords qw/quotewords/;
# 1.1 Global program state
my $empty = ''; # currently buffered empty lines
-my $opel = ''; # currently opened element
+my $close = ''; # buffered closing tag for currently opened element
# 1.2 Elements
@@ -58,11 +58,8 @@ sub request {
$empty = '';
# Close currently open block element, open new
- if (exists $blels{$opel}) {
- print end($blels{$opel}) . "\n";
- $opel = '';
- }
- $opel = $elkey;
+ print $close;
+ $close = interpol(end($blels{$elkey}), @argv) . "\n";
print interpol(start($blels{$elkey}), @argv) . "\n";
} elsif (exists $inels{$elkey}) {
@@ -113,7 +110,4 @@ while (<>) {
}
# 2.2 Close currently open block element
-if (exists $blels{$opel}) {
- print end($blels{$opel}) . "\n";
- $opel = '';
-}
+print $close;