At line 80 added 64 lines |
|
The spec should do the difference between an implicit and an explicit link instead of an internal and external one. |
|
An implicit link is a fully compliant URI in the text as defined by [RFC3986|http://www.ietf.org/rfc/rfc3986.txt] - no non-RFC3986 schemes allowed. The URI must be complete - no relative-ref (see Appendix A of the RFC). |
|
Example: |
By going to http://www.wikicreole.org, you will see[[...] |
|
(Should Creole eliminate explicit links altogether?) |
|
An explicit link is made of a destination and an optional description (or the other way around?) enclosed between two square brackets. These two parts are separated by a pipe character. |
|
The destination (target) can be the title of a page, an InterWiki link ([InterWiki standardization effort]), or a fully RFC3986-compliant URI-reference. |
|
The description part in a link could mean different things depending on the order: |
|
* {{{[[Hyperlinked Text|Target]]}}} i.e. [Hyperlink Text|target] |
* {{{[[Target|Alternate Text]]}}} i.e. {{{<a href="Target" |
alt="Alternate Text">Target</a>}}} |
|
In my experience, the former would work pretty well with external links and the latter with internal ones. |
|
So, my suggestion is this: |
|
{{{[[Hyperlinked Text|Target|Alternate Text]]}}} with the text and alternate text part optional. If there is a possible ambiguity, resolve it as {{{[[Text|Target]]}}}. Ex.: |
{{{ |
|
1. I have one existing wiki page called Foo. |
[[Foo|Bar]] would generate <a href="Foo" alt="Bar">Foo</a> |
|
2. I have one existing wiki page called Bar. |
[[Foo|Bar]] would generate <a href="Bar">Foo</a> |
|
3. I have two existing wiki pages: Foo and Bar. |
[[Foo|Bar]] would generate <a href="Bar">Foo</a> |
|
}}} |
|
Note: The rendering could be completely different depending on the implementation. Alternate text could be presented like hyperlinked text if none is present... |
|
In the first example, a problem arises when someone creates a page called "Bar" afterward... The rendering will change for the one in example 3. |
|
Also, how would I say in Creole something like: {{{ <a href="Foo" |
alt="Bar">Foo</a> }}} if I have two existing wiki pages : Foo and Bar. |
The easiest solution is to write empty parts: {{{[[|Foo|Bar]]}}}. |
Another possible solution is to "escape" one part or the other with quotes ("") - or another markup - to explicitly define the text or alt text (don't like that one). |
|
Finally, with the special syntax of InterWiki links and URIs, there should not be any ambiguity, only possible misleading from potentially mischievious users. Ex.: |
{{{[[http://www.google.com|http://www.myphishingsite.com]]}}} |
|
Just thinking aloud... Any ideas? Do I make sense? |
|
-- [EricChartre], 2007-01-01 |
|
Oh! and BTW, if the URI are compliant to RFC3986, and internal/InterWiki links do not contain spaces, it would be possible to use a space as a delimiter instead of a pipe. |
|
If a target does contain spaces, it must be enclosed between quotes. |
|
-- [EricChartre], 2007-01-01 |
|
Should Creole accept IRIs |
([RFC3987|http://www.ietf.org/rfc/rfc3986.txt]) instead of URIs? |
|
-- [EricChartre], 2007-01-01 |