Thread:Extension talk:LinkAttributes/alternate safer syntax

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

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 "mpty" 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

This is not the case with your extension that conflicts with displayed text:
 * my userpage|rel=me|attribute2=value2

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

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).

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