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
--
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/&/&\;/go;
$text =~ s/%/&\#037\;/go;
$text =~ s/</<\;/go;
$text =~ s/>/>\;/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