Tags:
create new tag
, view all tags

Bug: View raw=on is broken, shows raw=debug

The raw=on view shows now the debug view, it should show just the raw topic text without the meta data. This is a new bug of latest TWikiBetaRelease2004x07x29.

Test case

Environment

TWiki version: TWikiBetaRelease2004x07x29
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin, etc
Server OS: N/A
Web server: N/A
Perl version: N/A
Client OS: N/A
Web Browser: N/A

-- PeterThoeny - 30 Jul 2004

Fix record

This fix is now in SVN and TWiki.org. Removed the scheduled for Cairo since it was introduced recently.

This bug was caused by the following line in TWiki::UI::View, which was introduced recently to escape percent signs in raw text:

       $text =~ s/%/&\#037\;/go;

Unified diff:

--- bu4/View.pm Sat Jul 10 01:15:22 2004
+++ View.pm     Fri Jul 30 23:35:19 2004
@@ -132,25 +132,25 @@
     }
     $extra .= " (not exist)";
   }

   if( $viewRaw ) {
     $extra .= " raw=$viewRaw";
+    if( $viewRaw !~ /debug/i ) {
+      $text = join( "\n", grep{ !/^%META:([^{]+){(.*)}%$/ } split( /\r?\n/, $text ) );
+    }
     if( $skin !~ /^text/ ) {
       my $vtext = "<form><textarea readonly=\"readonly\" wrap=\"virtual\" rows=\"%EDITBOXHEIGHT%\" cols=\"%EDITBOXWIDTH%\">";
       $vtext = &TWiki::handleCommonTags( $vtext, $topic );
       $text =~ s/&/&amp\;/go;
       $text =~ s/%/&\#037\;/go;
       $text =~ s/</&lt\;/go;
       $text =~ s/>/&gt\;/go;
       $text =~ s/\t/   /go;
       $text = "$vtext$text</textarea></form>";
     }
-    if( $viewRaw !~ /debug/i ) {
-      $text =~ s/%META[\:A-Z]*{[^\}]*}%[\n\r]*//gos;
-    }
   }

   TWiki::UI::writeDebugTimes( "view - get rev info" );

   if( ! $viewRaw ) {
     $text = &TWiki::handleCommonTags( $text, $topic );

-- PeterThoeny - 30 Jul 2004

Follow up

Hmm, it looks like this fix breaks MetaFieldNotShownInViewRawMode, back to the drawing board, aka keyboard.

-- PeterThoeny - 30 Jul 2004

OK, fixed both cases, this topic and MetaFieldNotShownInViewRawMode. Change is in SVN.

-- PeterThoeny - 30 Jul 2004

Topic revision: r5 - 2004-07-31 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by PerlIdeas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.