Amendment to r36250.
authorDaniel Friesen <dantman@users.mediawiki.org>
Fri, 13 Jun 2008 02:47:10 +0000 (02:47 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Fri, 13 Jun 2008 02:47:10 +0000 (02:47 +0000)
Rather than adding a few extra characters to a single locale just to make it work. We should extend our base linkTrail to work properly in a universal matter.
From: http://www.regular-expressions.info/posixbrackets.html#class
The Unicode format for mathing all [:alpha:] characters is \p{L&}
I tested this on my own machine. Before applying it 99% of the special characters inside of Wikipedia's EditTools box would not be considered part of a linktrail.
However, after changing the a-z to use \p{L&} every last character listed there was considered part of the LinkTrail and that includes the ones that r36250 tried to fix.
Additionally, I also added ' to allow matching, but only at the start of the linktrail to allow for things like [[Bar]]'s to link correctly. It was tested and does not break the ''s used for emphasis, and does not linkify single quotes used to quote things rather than as an apostraphe.
I may make a second commit later to remove legacy $linkTrail definitions which are no longer needed.

languages/messages/MessagesEn.php
languages/messages/MessagesSzl.php

index 8370143..168a73c 100644 (file)
@@ -439,7 +439,7 @@ $specialPageAliases = array(
  * Regular expression matching the "link trail", e.g. "ed" in [[Toast]]ed, as
  * the first group, and the remainder of the string as the second group.
  */
-$linkTrail = '/^([a-z]+)(.*)$/sD';
+$linkTrail = '/^(\'?\p{L&}+)(.*)$/usD';
 
 #-------------------------------------------------------------------
 # Default messages
index dd37c74..6d4071d 100644 (file)
 
 $fallback = 'pl';
 
-/**
- * Regular expression matching the "link trail", e.g. "ed" in [[Toast]]ed, as
- * the first group, and the remainder of the string as the second group.
- */
-$linkTrail = '/^([a-zćčńřśšůźž]+)(.*)$/sDu';
-
 $messages = array(
 # User preference toggles
 'tog-underline'               => 'Podkreślyńy linkůw:',