diff options
-rwxr-xr-x | mh | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -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; |