r36253 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36252‎ | r36253 | r36254 >
Date:02:47, 13 June 2008
Author:dantman
Status:old
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesSzl.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/messages/MessagesSzl.php
@@ -17,12 +17,6 @@
1818
1919 $fallback = 'pl';
2020
21 -/**
22 - * Regular expression matching the "link trail", e.g. "ed" in [[Toast]]ed, as
23 - * the first group, and the remainder of the string as the second group.
24 - */
25 -$linkTrail = '/^([a-zćčńřśšůźž]+)(.*)$/sDu';
26 -
2721 $messages = array(
2822 # User preference toggles
2923 'tog-underline' => 'Podkreślyńy linkůw:',
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -439,7 +439,7 @@
440440 * Regular expression matching the "link trail", e.g. "ed" in [[Toast]]ed, as
441441 * the first group, and the remainder of the string as the second group.
442442 */
443 -$linkTrail = '/^([a-z]+)(.*)$/sD';
 443+$linkTrail = '/^(\'?\p{L&}+)(.*)$/usD';
444444
445445 #-------------------------------------------------------------------
446446 # Default messages

Follow-up revisions

RevisionCommit summaryAuthorDate
r36471Update linktrail parser test case for change in r36253: default linktrail now...brion17:49, 19 June 2008
r38751(Bug 15035) Revert linkTrail to /^([a-z]+)(.*)$/sD, as it was before r36253. ...tstarling04:32, 7 August 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r36250* bug 14512 - Add link trail on Slavic "ů" character...danny_b23:45, 12 June 2008

Status & tagging log