Fix regular expression.

The regular expression used to split the page content had a few pipe
characters in the wrong places, due to the previous 'cleaning-up' of the
convoluted expression for version 2.3.0.
This commit is contained in:
Daniel Kraus
2013-08-29 19:54:57 +02:00
parent 13db185d18
commit 33a2169301
3 changed files with 8 additions and 5 deletions

View File

@ -107,9 +107,9 @@
if ( $wgLinkTitlesSkipTemplates )
{
$templatesDelimiter = '{{.+?}}';
$templatesDelimiter = '{{.+?}}|';
} else {
$templatesDelimiter = '{{[^|]+?}}|{{.+\|';
$templatesDelimiter = '{{[^|]+?}}|{{.+\||';
};
// Build a regular expression that will capture existing wiki links ("[[...]]"),
@ -127,8 +127,8 @@
$templatesDelimiter . // templates (if requested)
'^ .+?\n|\n .+?\n|\n .+?$|^ .+?$|' . // preformatted text
'<nowiki>.*?<.nowiki>|<code>.*?<\/code>|' . // nowiki/code
'|\[' . $urlPattern . '\s.+?\]|'. $urlPattern . '(?=\s|$)' . // urls
'|(?<=\b)\S+\@(?:\S+\.)+\S+(?=\b)' . // email addresses
'\[' . $urlPattern . '\s.+?\]|'. $urlPattern . '(?=\s|$)|' . // urls
'(?<=\b)\S+\@(?:\S+\.)+\S+(?=\b)' . // email addresses
')/i';
$black_list = str_replace( '_', ' ',

View File

@ -49,7 +49,7 @@
'name' => 'LinkTitles',
'author' => '[https://www.mediawiki.org/wiki/User:Bovender Daniel Kraus]',
'url' => 'https://www.mediawiki.org/wiki/Extension:LinkTitles',
'version' => '2.3.0',
'version' => '2.3.1',
'descriptionmsg' => 'linktitles-desc'
);

3
NEWS
View File

@ -1,3 +1,6 @@
LinkTitles 2.3.1: 2013-08-29
* Fix bug introduced with 2.3.0 that prevented the extension from working...
LinkTitles 2.3.0: 2013-08-28
* No longer mess up pages if a page title started with a slash.
* Do not link preformatted text and text enclosed in <nowiki> or <code>