blacksqr / wikitcl

Automatically exported from code.google.com/p/wikitcl
0 stars 0 forks source link

Limit spaces in wiki page name #252

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The Fossil source code contains this interesting comment:

** Well-formed wiki page names do not begin or end with whitespace,
** and do not contain tabs or other control characters and do not
** contain more than a single space character in a row.  Well-formed
** names must be between 3 and 100 chracters in length, inclusive.

I suggest we introduce something similar for the Tcl Wiki.  It would have 
avoided the problem documented in issue 238 "Cannot link to Wiki page with 
space at end of name".

Original issue reported on code.google.com by andrew.m.goth@gmail.com on 24 Nov 2011 at 7:05

GoogleCodeExporter commented 8 years ago
One option is to automatically [regsub -all {\s+} [string trim $title] " "] on 
all page titles, both when creating pages and when making links.  Then the Wiki 
markup [foo bar] and [foo  bar] and [ foo bar] would all point to the same 
place.  First audit the database to see if any existing page names already have 
control characters, leading/trailing space, or multiple spaces in a row; you 
might want to canonicalize those names, or else it would no longer be possible 
to link to them.

Original comment by andrew.m.goth@gmail.com on 27 Feb 2012 at 6:00

GoogleCodeExporter commented 8 years ago
Today we had an incident where two pages were created with apparently the same 
name.  The only difference is one of the pages contains a doubled space between 
two words, and because of the way HTML works, the only way to see this 
difference is to look at the page source.

http://wiki.tcl.tk/36721 "Dynamic File Link behaviour in a text widget"
http://wiki.tcl.tk/36720 "Dynamic File Link  behaviour in a text widget"

[regsub -all {\s+} [string trim $title] " "] would have avoided this problem.

Original comment by andrew.m.goth@gmail.com on 19 Jul 2012 at 6:21