Thanks to gwicke on irc for teaching me how to stop + or * to be greedy (ie replace by +? and *?).
Space around column are striped from link but the link title still show the spaces.
$r = substr( $t, 1 );
} else {
# Namespace or interwiki prefix
- if ( preg_match( "/^((?:i|x|[a-z]{2,3})(?:-[a-z0-9]+)?|[A-Za-z0-9_\\x80-\\xff]+):_*(.*)$/", $t, $m ) ) {
+ if ( preg_match( "/^((?:i|x|[a-z]{2,3})(?:-[a-z0-9]+)?|[A-Za-z0-9_\\x80-\\xff]+?)_*:_*(.*)$/", $t, $m ) ) {
#$p = strtolower( $m[1] );
$p = $m[1];
if ( $ns = $wgLang->getNsIndex( strtolower( $p ) )) {