Thread:Extension talk:LinkAttributes/alternate safer syntax

Instead of the syntax you propose that alters the meaning of the displayed text (pipes no longer working the same way, and even broken pipes now):

which normally means the standard wikilink rendered as:
 * my userpage|rel=me|attribute2=value2

It would seem more natural to put attributes at the begining where it is easy to discriminate them from a pagename:

The leading pipe isolates an "empty" page name that annot be a valid target link; at this time, the next pipe separators are used to separate one or more attributes (all of them must have an equal sign to create the attribute's key=value pair), an empty part terminates the sequence and indicates that what follows is the wikilink (which can include an equal sign but no pipe!), and everything after the next pîpe is part of the displayed text (including all other pipes up to the double closing brackets).

With the unextended wiki parser you get this plain text, kept verbatim by MediaWiki (confirming that the leading pipe between brackets cannot be a classic wikilink target:
 * attribute2=value2||User:Verdy_p|my userpage

Note also how this renders if you forget the leading pipe (MediaWiki still attempts to parse a wikilink to a page named "rel=me")
 * attribute2=value2||User:Verdy_p|my userpage

And this last example explains why we need a way to terminate attributes with double pipes before the wikilink target (where equal signs are valid part of target page names. However we may forget the double pipe if what follows the last attribute is a page name that has no equal sign (the double pipe is an escaping mechanism not needed below as the target page has no equal sign in its name):
 * attribute2=value2|User:Verdy_p|my userpage

Another way to specify attributes could be to put them between square brackets, anywhere within the wikilink target part (because standard wikilink targets cannot contain square brackets) :

which MediaWiki will also leaves as verbatim text:
 * attribute2=value2]User:Verdy_p|my userpage
 * my userpage
 * my userpage
 * attribute2=value2]|my userpage

This is not the case however if you put bracketed attributes in the second part:

which gives a standard wikilink (not what we want)
 * my userpage[rel=me]

In summary: any extensions for wikilinks must be within their 1st part, not their 2nd part containing the displayed text, and use the restrictions that apply to valid link targets (it is even possible that MediaWiki will accept to insert embedded links within them, for example a whole line going somewhere, except one small icon or small notecall going somewhere else):
 * my userpage is here (but my [[User talk:Verdy_p|talk page is elsewhere)]]

For now this syntax is not accepted in standard MediaWiki, but it should remain valid to put embedded links within a larger surrounding link (it is perfectly valid in pure HTML).

One of the most desired feature for attributes of wikilinks would be to allow them to be styled in a much simpler way (without having to use complex HTML spans in the second part):
 * my userpage

But we could also give them other common attributes (all predefined in the standard HTML anchor "a" element) such as "id=*", "title=*", "lang=*"

Another usage would be to give attributes to numbered or bulleted lists, including in the middle of the list, without interrupting it, by defining special targets (they'll reach an HTML "li", or "dd" or "dt" attribute), for such usage the second part is just standard wiki text but optional (it may still be useful to delimit it if it has to spen several lines:
 * (note that Wiki page names with an asterisk * are valid)
 * (note that Wiki page names with an asterisk * are valid)

Thanks... this is just a suggestion...