From: Jan H. <hi...@wi...> - 2000-12-06 15:14:40
|
On Wed, Dec 06, 2000 at 12:18:23PM +0100, Arno Hollosi wrote: > > > > During my efforts to get this done I noticed a minor bug in the > > > function ExtractWikiPageLinks. If you have something in your text like > > > "[[not a link]" then the page name "[not a link" is extracted as a link > > > name and turns up, for example, in MySQL in the table wikilinks. My > > > patch also fixes this. > > > > Confirmed on my Postgresql installation... nice catch! > > This bug has been fixed since stdlib.php v1.12 from November 16th. > Are you sure you tested the latest build? Oops. I didn't. My apologies. The latest nightly build in the FTP directroy seems to be the one of Nov. 5. But I will probably be able to get it by CVS. > > > 3. Are square brackets in page names allowed? > > Currently: no. > And yes, any attempt to use "]" inside links has unpredicted consequences. Well, a single "]" is predictable; it always closes the link. And a single "[" does also what you would expect. Its when you use "]]" or "[[" that things become funny. But this is besides the point. > > Well, can you give some reasons why it should be allowed? Well, in a FAQ I would expect link names like "Why can't I have ']'s in my link names?". :-) But seriously, no, I have no concrete example of a useful link name with brackets in it. But then again, I am also not really sure that no-one is ever going to need one. > Me wonders too. You know, for my petproject "Sensei's Library" I have > modified it the following way. Bracketlinks are possible, but they have a > restricted regexp. Basically it boils down to that [some page] is equal to > SomePage or [yet another page] == YetAnotherPage. I.e. it is only used for > readability purposes. Well, ok I filter out some chars as well so that > e.g. [Sensei's Library] == SenseisLibrary. But wouldn't then the title of the page show up as "Senseis Library"? > > > solve this I would suggest that closing brackets should also be > > > escaped, i.e., ']' should be written as ']]' if it is not meant as an > > That's logically consistent... What do you think Arno? > > [..] > > I assume that allowing those brackets causes more trouble for casual > visitors seeing and trying to recreate links like "cool [awesome] page". Hm. Maybe, but if you are going to recreate something, you can always easily check how the original was done. In fact, if I hadn't seen the example of [[link name] I probably would have tried [[link name]] first. > A straight-forward failure to use "]" is easier to understand. And don't > tell me it can be found in the manual somewhere. People don't read manuals. In the edit page it now says 'escape "[" with "[["'. You could simply change that into escape '"[" and "]" with "[[" and "]]"'. I don't think that is really hard to understand. And the way that things are currently implemented (replacing escaped things with tokens) the standard example of "[[link name]" would still work. The only thing that would really change is that "bla ]] bla"" will be transformed to "bla ] bla". But how often do you write something like that? The only two difficulties that I see are that 1. during transformation you have to take into account that link names may contain tokens 2. when extracting links you have to take into acount that link names may contain escaped symbols such as [[ and ]] -- Jan Hidders |