Tags:
create new tag
view all tags

Question

Forced link, as far as I know, is by using double square brackets around some words, and TWiki will convert the string into a Wiki Word.

I create the following: [[Forced link - good]] which gives me Forced link - good. I click on ? and edit it. The file created is 'ForcedLink-Good' - which is ok. Now go back to the page with the link pointing to it, you will notice that the ? is still there. The problem is that the link name has a space between 'k' and '-'. Since the file name created has no space, it looks like it's lost. User loses hours of work when he saves over it.

BTW, similar problem occurs not just with -, but ( as well, eg. Forced link (good)

The behavior mentioned here occurs under Dakar. On old version, a file with one space actually got created 'ForcedLink -Good', but after saving an error would pop up saying file doesn't exist (but going back to the page with the link, the link looks ok). Either way, it causes confusion to the user, which is bad.

The assumed behaviour (and it will be fine) is that all spaces are removed (ForcedLink-Good). If we are to say that Wiki Word should not contain dashes and other special characters, it could change it to ForcedLinkGood, but not leaving a space around and cause confusion. Please help.

Environment

TWiki version: TWikiRelease04x00x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: rhel 3
Web server: apache 2
Perl version: 5.8
Client OS: xp
Web Browser: ie 6
Categories: Fatal error

-- JohnnyKwei - 18 May 2006

Answer

I have filed this is our bug base as Bugs:Item2318 and it will be fixed in 4.0.3.

If you want to fix this in your own installation, you can apply this little patch:

--- lib/TWiki/Render.pm       (revision 10235)
+++ lib/TWiki/Render.pm       (working copy)
@@ -718,6 +718,8 @@
     $link =~ s/^(.)/\U$1/;
     # Collapse spaces and capitalise following letter
     $link =~ s/\s([$TWiki::regex{mixedAlphaNum}])/\U$1/go;
+    # Get rid of remaining spaces, i.e. spaces in front of -'s and ('s
+    $link =~ s/\s//go;

     $topic = $link if( $link );

Thanks for reporting this!

-- SteffenPoulsen - 19 May 2006

Thanks Steffen for acting so quickly!

-- PeterThoeny - 19 May 2006

Cool! Thanks!

-- JohnnyKwei - 03 Jun 2006

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2006-06-03 - JohnnyKwei
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.