Here's a controversial proposal: allow external links to be wrapped in double brackets: [[http://foo.com]].
Rationale: My grammar (and the existing parser, I believe) have to go out of their way to detect these malformed external links, then explicitly treat them as a normal external link wrapped in extra brackets:
[<a href="http://foo.com">[1]</a>]
However, what the user almost certainly wanted was:
<a href="http://foo.com">[1]</a>
So this is a case of existing wikitext probably being written with a different intention to how the parser is actually rendering it.
Since we have to explicitly detect this situation, wouldn't it make more sense to render it how the user wants it while we're at it?
Steve PS This is a somewhat idle query - compared to the amount of work involved in rewriting the parser, this is a trivial change either way. I'm just curious what kinds of improvements could be made that fit within the "don't break existing wikitext"/"mimic what people are expecting" guidelines.
On 26/11/2007, Steve Bennett stevagewp@gmail.com wrote:
Here's a controversial proposal: allow external links to be wrapped in double brackets: [[http://foo.com]].
[[http://foo.com]] almost certainly is intended to be rendered as <a href="http://foo.com">[1]</a>, I agree. However, [[http://foo.com foo]] may well be wanted as [<a href="http://foo.com">foo</a>] (ie. [foo] with only the inside linked). Would your plan only be for external links with default link text, or would it be for all external links? If the latter, I think it's a bad idea.
On 11/27/07, Thomas Dalton thomas.dalton@gmail.com wrote:
[[http://foo.com]] almost certainly is intended to be rendered as <a href="http://foo.com">[1]</a>, I agree. However, [[http://foo.com foo]] may well be wanted as [<a href="http://foo.com">foo</a>] (ie. [foo] with only the inside linked). Would your plan only be for external links with default link text, or would it be for all external links? If the latter, I think it's a bad idea.
Insofar as it's a plan and not just idle speculating, you mean...
Yes, I think in the second case it becomes ambiguous, so probably best to treat the brackets as intentional.
However there is one third situation:
[[http://foo.com%7CFoo is great]] - how do you treat this?
I don't really like the distinct internal/external link syntax. It's not possible to internally link to an article that has a name that could be a URL, so there is no possibility of ambiguity. Hence, why have different syntaxes for something that is so obviously related?
[[foo|blah]] [[http://foo.com%7Cblah]]
Why not? Is | a valid character in URLs?
Steve
On 26/11/2007, Steve Bennett stevagewp@gmail.com wrote:
Why not? Is | a valid character in URLs?
Yes! I can't think of any examples right now, but I remember a then-major site in the mid-'90s that was quite fond of them.
- d.
Steve Bennett wrote:
Here's a controversial proposal: allow external links to be wrapped in double brackets: [[http://foo.com]].
Rationale: My grammar (and the existing parser, I believe) have to go out of their way to detect these malformed external links, then explicitly treat them as a normal external link wrapped in extra brackets:
[<a href="http://foo.com">[1]</a>]
However, what the user almost certainly wanted was:
<a href="http://foo.com">[1]</a>
So this is a case of existing wikitext probably being written with a different intention to how the parser is actually rendering it.
Since we have to explicitly detect this situation, wouldn't it make more sense to render it how the user wants it while we're at it?
Steve PS This is a somewhat idle query - compared to the amount of work involved in rewriting the parser, this is a trivial change either way. I'm just curious what kinds of improvements could be made that fit within the "don't break existing wikitext"/"mimic what people are expecting" guidelines.
Would fit the expectatives. It's a commons mistake among beginners. However, not only they have a different syntax for brackets, also for separators. So if you "fixed" it, you could end up making a link as <a href="http://www.example.org/|Nice">site</a> Also, it would further restrict available pagenames: Things like http://en.wikipedia.org/wiki/Http://www.google.com *do* exist!
It is however an interesting proposal, as you wouldn't need to recognise [http:// links at all. You would simply define http: as a special namespace linking to that page (same with ftp:, mailto:...).
Would fit the expectatives. It's a commons mistake among beginners. However, not only they have a different syntax for brackets, also for separators. So if you "fixed" it, you could end up making a link as <a href="http://www.example.org/|Nice">site</a> Also, it would further restrict available pagenames: Things like http://en.wikipedia.org/wiki/Http://www.google.com *do* exist!
It is however an interesting proposal, as you wouldn't need to recognise [http:// links at all. You would simply define http: as a special namespace linking to that page (same with ftp:, mailto:...).
You could even do something really clever allowing articles to be created in the http namespace and have redlinks to them go directly to the webpage (the link wouldn't actually be red, of course), but if the page exists, it displays with the title automatically a link to the webpage, or something like that.
God knows why you would want to do any of that, but it would be clever. ;)
On Mon, Nov 26, 2007 at 05:58:54PM +0000, Thomas Dalton wrote:
It is however an interesting proposal, as you wouldn't need to recognise [http:// links at all. You would simply define http: as a special namespace linking to that page (same with ftp:, mailto:...).
You could even do something really clever allowing articles to be created in the http namespace and have redlinks to them go directly to the webpage (the link wouldn't actually be red, of course), but if the page exists, it displays with the title automatically a link to the webpage, or something like that.
God knows why you would want to do any of that, but it would be clever. ;)
God may not know why *WMF* would want to do that... but, say it with me now:
WMF isn't the only client for Mediawiki.
Cheers, -- jra
On 11/27/07, Jay R. Ashworth jra@baylink.com wrote:
WMF isn't the only client for Mediawiki.
It is, however, explicitly the *primary* client for MediaWiki. I'm sure that's written...somewhere.
Steve
On Tue, Nov 27, 2007 at 04:21:12PM +1100, Steve Bennett wrote:
On 11/27/07, Jay R. Ashworth jra@baylink.com wrote:
WMF isn't the only client for Mediawiki.
It is, however, explicitly the *primary* client for MediaWiki. I'm sure that's written...somewhere.
Oh, sure.
My point was merely that "we don't want it to do that" carries a fair amount of weight when the board says it, but "why would we want that"... maybe not so much. People doing what you're doing (and thanks, BTW, for doing it, in case no one's said) need to be thinking about both sides of that coin.
Cheers, -- jra
God knows why you would want to do any of that, but it would be clever. ;)
God may not know why *WMF* would want to do that... but, say it with me now:
WMF isn't the only client for Mediawiki.
By "you" I meant all users of Mediawiki. I can't see why anyone would want such a feature, it just appealed to me as cool from a technical perspective, so I thought I'd mention it.
On Tue, Nov 27, 2007 at 12:40:42PM +0000, Thomas Dalton wrote:
God knows why you would want to do any of that, but it would be clever. ;)
God may not know why *WMF* would want to do that... but, say it with me now:
WMF isn't the only client for Mediawiki.
By "you" I meant all users of Mediawiki. I can't see why anyone would want such a feature, it just appealed to me as cool from a technical perspective, so I thought I'd mention it.
Well, I'd have to go back to my archive to see what the feature actually was, now (I run a *lot* of mail in a day, and I'm sick this week anyway), but rest assured, I thought it was a cool idea as well, or I wouldn't have stuck my neck up. :-)
Cheers, -- jra
On 11/27/07, Platonides platonides@gmail.com wrote:
Would fit the expectatives. It's a commons mistake among beginners. However, not only they have a different syntax for brackets, also for separators. So if you "fixed" it, you could end up making a link as <a href="http://www.example.org/|Nice">site</a> Also, it would further restrict available pagenames: Things like http://en.wikipedia.org/wiki/Http://www.google.com *do* exist!
Yeah, and given that David says | characters exist in URL's, life is a bit more complex. You could do something like this:
[[http://www.foo...]] - parsed like an internal link, | is a caption separator, space is treated literally (or perhaps escaped as %20), the full range of URLs is therefore not available (or perhaps with nowiki) [http://www.foo...] - parsed as at present, space is a separator, | is literal. http://www.foo - parsed as at present, space is the end of the URL, | is literal.
Hmph, too much complexity for too little gain. Probably better just to warn the user (oops, did I say warn? I meant, give encouraging advice to) at the time they commit the error (I mean, expressed their intent using syntax we unfortunately don't support).
It is however an interesting proposal, as you wouldn't need to recognise [http:// links at all. You would simply define http: as a special namespace linking to that page (same with ftp:, mailto:...).
Eep.
Steve
wikitext-l@lists.wikimedia.org