Bug: Raw view has tab instead of sets of 3 spaces
When a topic is stored sets of 3 spaces at the start of each line are converted to tabs. When the user edits they are converted back. When using ?raw=on users expect to see the same text the get when editing, so raw should also convert to spaces.
Test case
Create a topic with a line with 3 spaces then " * a bullet". Save and use more to get raw view - you'll see a tab at the start of the line.
Environment
| TWiki version: |
|
| TWiki plugins: |
|
| Server OS: |
|
| Web server: |
|
| Perl version: |
|
| Client OS: |
|
| Web Browser: |
|
--
JohnTalintyre - 28 May 2002
Follow up
Fix record
Here is the patch, which adds 2 lines like the following to
bin/view :
NoTabsInRawView.patch
$text =~ s/\t/ /go;
--
ColasNahaboo - 28 May 2002
Thanks for reporting this. It needs to be fixed. Though it is not that serious since tabs will be converted when you save and reload the topic.
A more serious problem is that the raw view strips out
<nop>, and that
HTML entities like
< are expanded. That means text gets altered in away that you cannot simply do a copy & paste to recover from a previous release.
Test Case: This WebNotify topic is escaped by
<nop>.
--
PeterThoeny - 28 May 2002
This is now fixed, in
TWikiAlphaRelease and at TWiki.org:
Index: view
===================================================================
RCS file: /cvsroot/twiki/twiki/bin/view,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -r1.57 -r1.58
*** view 5 Jan 2003 02:38:11 -0000 1.57
--- view 5 Jan 2003 09:19:17 -0000 1.58
***************
*** 153,156 ****
--- 153,160 ----
my $vtext = "<form><textarea readonly=\"readonly\" wrap=\"virtual\"
rows=\"%EDITBOXHEIGHT%\" cols=\"%EDITBOXWIDTH%\">";
$vtext = &TWiki::handleCommonTags( $vtext, $topic );
+ $text =~ s/&/&<nop>amp\;/go;
+ $text =~ s/</&<nop>lt\;/go;
+ $text =~ s/>/&<nop>gt\;/go;
+ $text =~ s/\t/ /go;
$text = "$vtext$text</textarea></form>";
if( $viewRaw !~ /debug/i ) {
--
PeterThoeny - 05 Jan 2003
Ok, I added another patch
NoTabsInRawView2.patch
for people wanting this also on their stable release...
--
ColasNahaboo - 06 Jan 2003