We've been discussing the problem that everything is valid in Wikitext, meaning that even the wild code noted by Steve Bennett:
Try this:
[[Foo|<pre>Magic link!</pre>]]
(for extra points try and predict what will happen first...)
This one is less exciting, but also odd:
[[Foo|Not what I <gallery>Image:foo.jpg</gallery> expected...]]
...comes out as SOMETHING. As he noted however, it's highly unexpected.
People have suggested that we output error messages instead of unexpected results (me included) but I have changed my mind as this is clearly user unfriendly.
What I think we should do instead is just alter the parser to output things more intuitively. This move would directly break current usage, BUT ONLY IN CASES OF *UNEXPECTED OUTPUT*. The breakage would only be on the kinds of output no one intends ANYWAY.
The kind of thing I'm talking about is rendering:
;Life, The Universe and Everything: :Forty Two
correctly (i.e. a definition title with a colon at the end, followed by the definition, rather than being followed by an empty definition). There are a large number of other tweaks we could make which, if made, would only improve rendering - they would eliminate the cases where unexpected results are arrived at.
Because ultimately that's what we're talking about. We want to eliminate unexpected results, and we've suggested swapping them out for error messages. Why not just swap them out for expected results?
P.S. In the case of something like [[Foo:Bar|Baz<pre>Foo</pre>Bar]] the syntax should either be taken as so wrong that it outputs literally, or, highly preferred, it should work out that the user is very likely trying to attempt the equivalent of the following: [[Foo:Bar|Baz]]<pre>[[Foo:Bar|Foo]]</pre>[[Foo:Bar|Bar]]
On 15/11/2007, Virgil Ierubino virgil.ierubino@gmail.com wrote:
What I think we should do instead is just alter the parser to output things more intuitively. This move would directly break current usage, BUT ONLY IN CASES OF *UNEXPECTED OUTPUT*. The breakage would only be on the kinds of output no one intends ANYWAY. P.S. In the case of something like [[Foo:Bar|Baz<pre>Foo</pre>Bar]] the syntax should either be taken as so wrong that it outputs literally, or, highly preferred, it should work out that the user is very likely trying to attempt the equivalent of the following: [[Foo:Bar|Baz]]<pre>[[Foo:Bar|Foo]]</pre>[[Foo:Bar|Bar]]
Yep. More magic! Magic in the cause of a good interface is good!
The trick being how to do it in ways that don't make parser.php maintainers and third-party implementers. Doing it the present way has led us here ...
- d.
What I think we should do instead is just alter the parser to output things more intuitively. This move would directly break current usage, BUT ONLY IN CASES OF *UNEXPECTED OUTPUT*. The breakage would only be on the kinds of output no one intends ANYWAY.
A lot of people have said that it is all but inevitable that a few corner cases are going to have to be treated differently than they are now. Your proposal is just a particular example of that.
On 11/15/07, Virgil Ierubino virgil.ierubino@gmail.com wrote:
What I think we should do instead is just alter the parser to output things more intuitively. This move would directly break current usage, BUT ONLY IN CASES OF *UNEXPECTED OUTPUT*. The breakage would only be on the kinds of output no one intends ANYWAY.
I think the general approach is to note the syntax that use currently and expect to work, and make sure it works the same way. When people use syntax that they don't really expect to work, we should attempt to fail gracefully, but not necessarily try too hard to produce the exact behaviour of the current parser.
In the case of [[Foo|baz<pre>wah</pre>]], no one is using this syntax, and no one would expect it to do anything in particular. Therefore we can render it pretty much however we want, though I'd be inclined to just strip out the <pre>'s. If you really really really wanted to second guess the editor (a terrible idea), they probably mean [[Foo|baz<code>wah</code>]], which works fine.
Too much magic causes the users to rely on the magic rather than just learning the syntax properly.
Steve
On Fri, Nov 16, 2007 at 11:18:40AM +1100, Steve Bennett wrote:
Too much magic causes the users to rely on the magic rather than just learning the syntax properly.
The lack of a formally defined syntax causes the users to rely on the magic since they have no other choice. ;-)
Cheers, -- jr 'any syntax distinguishable from magic is insufficiently advanced' a
wikitech-l@lists.wikimedia.org