From 416c844808cd6dbc9fa35c6e5bdad99b696bdf3c Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Fri, 13 Jun 2008 02:47:10 +0000 Subject: [PATCH] Amendment to r36250. 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 | 2 +- languages/messages/MessagesSzl.php | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 837014360d..168a73c331 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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 diff --git a/languages/messages/MessagesSzl.php b/languages/messages/MessagesSzl.php index dd37c74fec..6d4071d107 100644 --- a/languages/messages/MessagesSzl.php +++ b/languages/messages/MessagesSzl.php @@ -17,12 +17,6 @@ $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:', -- 2.20.1