From: <Raf...@nt...> - 2005-10-14 01:11:24
|
Author: RafaelAlvarez Date: 2005-10-13 18:10:34 -0700 (Thu, 13 Oct 2005) New Revision: 7035 Modified: twiki/branches/DEVELOP/lib/TWiki.pm Log: Item700: Now <verbatim> blocks in INCLUDEd files get expanded at the end of the rendering process. Modified: twiki/branches/DEVELOP/lib/TWiki.pm =================================================================== --- twiki/branches/DEVELOP/lib/TWiki.pm 2005-10-14 00:52:29 UTC (rev 7034) +++ twiki/branches/DEVELOP/lib/TWiki.pm 2005-10-14 01:10:34 UTC (rev 7035) @@ -2196,9 +2196,11 @@ # Plugin Hook (for cache Plugins only) $this->{plugins}->beforeCommonTagsHandler( $text, $theTopic, $theWeb ); - my $verbatims = {}; + #use a "global var", so included topics can extract and putback + #their verbatim blocks safetly. + $this->{_verbatims}={}; $text = $this->{renderer}->takeOutBlocks( $text, 'verbatim', - $verbatims ); + $this->{_verbatims}); my $memW = $this->{SESSION_TAGS}{INCLUDINGWEB}; my $memT = $this->{SESSION_TAGS}{INCLUDINGTOPIC}; @@ -2225,10 +2227,11 @@ # SMELL: is this a hack? Looks like it.... $text =~ s/^<nop>\r?\n//gm; - $this->{renderer}->putBackBlocks( \$text, $verbatims, 'verbatim' ); + $this->{renderer}->putBackBlocks( \$text, $this->{_verbatims}, 'verbatim' ); # TWiki Plugin Hook (for cache Plugins only) $this->{plugins}->afterCommonTagsHandler( $text, $theTopic, $theWeb ); + $this->{_verbatims}=undef; return $text; } |