Markup spec/BNF/Links

This page references elements defined in Markup spec/BNF/Fundamental elements and Markup spec/BNF/Article title


 * Internal and external links work fundamentally differently in MediaWiki, and should likely be treated separately. --Brion VIBBER 04:08, 29 May 2006 (UTC)


 * Do you mean to separate out their definitions, or to remove the element and add its current definition wherever it would otherwise be used? I think it makes logical sense to keep the top-level definition, but I have separated out the definitions, which I hope will aid clarity. --HappyDog 13:46, 29 May 2006 (UTC)

Internal links

 * Remarks
 * Logically, internal-link should be matched in preference to external-link, as that's how the current parser does it. However, the current parser also explicitly checks for an accidental match of an external link in an inside link (that is, [] ) and converts it back to an external link.

Categories
In the current parser, categories are just a mildly special case of an internal link. But to the user they seem quite different, and the final behaviour is very different. So let's treat them specially.

(* section-ids are technically tolerated currently. but they do nothing and aren't used. *) (* similarly a pipe without a sort key is technically tolerated but isn't useful. *) ::=   ":"  [  ] 

   ::= NS_CATEGORY (* set in languages/messages/MessagesXx.php. By default, "Category" *)

(*  specified above. for a category, it's possibly more restrictive. *) (* other bits specified above. *)


 * Remarks
 * A link *to* a category is handled by internal-link above.

Rendering
A category link produces no inline text. However, the fact of the link (with possible manual sort key) is stored, and possibly rendered by the skin.

Internal link to HTML
URL = $5$6

Where

if is blank $1 = internal variable $wgScript else $1 = looked up in DB, based on value of $2 =   If destination page exists $3 = "&amp;amp;action=edit" $4 = " class="new"" else $3 and $4 are blank If is blank $5 =  else $5 = $6 = 