From 1511fba8e989df3dcdb4f6253e6c696a2e1944b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 1 Dec 2020 00:15:19 +0100 Subject: Fix closing tag not being interpolated --- mh | 14 ++++---------- 1 file 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; -- cgit v1.2.3