• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

When a plugin implements the (deprecated) endRenderingHander() and calls Func::renderText() in it, verbatim blocks stored in the global variable {session}->{_removed} are lost. Making the blocks map local to getRenderedVersion() cures the symptoms again.

--- lib/TWiki/Render.pm (revision 7418)
+++ lib/TWiki/Render.pm (working copy)
@@ -987,9 +987,10 @@
     my $removedComments = {};
     my $removedScript = {};
     my $removedHead = {};
+    my $verbatims = {};

     $text = $this->takeOutBlocks( $text, 'finished_rendering', $session->{_removed} );
-    $text = $this->takeOutBlocks( $text, 'verbatim', $session->{_removed} );
+    $text = $this->takeOutBlocks( $text, 'verbatim', $verbatims );

     $text = $this->takeOutProtected( $text, qr/<\?([^?]*)\?>/s,
                                      $removedComments );
@@ -1220,7 +1221,7 @@
     $plugins->endRenderingHandler( $text );

     # replace verbatim with pre in the final output
-    $this->putBackBlocks( \$text, $session->{_removed}, 'verbatim', 'pre', \&verbatimCallBack );
+    $this->putBackBlocks( \$text, $verbatims, 'verbatim', 'pre', \&verbatimCallBack );
     $this->putBackBlocks( \$text, $session->{_removed}, 'finished_rendering', '');

     $text =~ s|\n?<nop>\n$||o; # clean up clutch

But I am not sure if this is the right fix.

(Don't recommend not to do that.)

it might take a little while, but i'll look into it smile -- SD

svn:7446 -- SD

ItemTemplate
Summary losing verbatim blocks in nested calls to getRenderedVersion()
ReportedBy MichaelDaum
AppliesTo Engine
Component

Priority Urgent
CurrentState Closed
WaitingFor

Checkins 7446
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r4 - 2005-11-13 - SvenDowideit
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback