Patch to ca, kaa linktrails to exclude multiple apostrophes by Platonides: https://bugzilla.wikimedia.org/attachment.cgi?id=8337
Added parser test cases to confirm that the linktrail apostrophe works on those languages, and to confirm that the bug where a link is surrounded by bold or italics is resolved.
Tweaked Linker::splitTrail() to keep it from permanently caching $wgContLang's linktrail; when we change content languages during a script run as we do with parser tests, that was leaving us stuck forever on English's linktrail.
This may slightly slow down that path, since it'll have to make a couple brief function calls into the Language object and its data cache.
* (bug 28430) Make html and TeX output of <math> always be left-to-right.
* (bug 28306) Fix exposure of suppressed usernames in ForeignDBRepo
* (bug 28372) Fix bogus link to suppressed file versions in ForeignDBRepo
+* (bug 27473) Fix regression: bold, italic no longer interfere with linktrail for ca, kaa
=== API changes in 1.18 ===
* (bug 26339) Throw warning when truncating an overlarge API result
* as a two-element array
*/
static function splitTrail( $trail ) {
- static $regex = false;
- if ( $regex === false ) {
- global $wgContLang;
- $regex = $wgContLang->linkTrail();
- }
+ global $wgContLang;
+ $regex = $wgContLang->linkTrail();
$inside = '';
if ( $trail !== '' ) {
$m = array();
'DeletedContributions' => array( 'Contribucions esborrades' ),
);
-$linkTrail = '/^([a-zàèéíòóúç·ïü\']+)(.*)$/sDu';
+$linkTrail = "/^((?:[a-zàèéíòóúç·ïü]|'(?!'))+)(.*)$/sDu";
$messages = array(
# User preference toggles
'ISO 8601 both' => 'xnY-xnm-xnd"T"xnH:xni:xns',
);
-$linkTrail = "/^([a-zı'ʼ’“»]+)(.*)$/sDu";
+$linkTrail = "/^((?:[a-zıʼ’“»]|'(?!'))+)(.*)$/sDu";
$messages = array(
# User preference toggles
</p>
!!end
+!! test
+Internal link with ca linktrail, surrounded by bold apostrophes (bug 27473 primary issue)
+!! options
+language=ca
+!! input
+'''[[Main Page]]'''
+!! result
+<p><b><a href="/wiki/Main_Page">Main Page</a></b>
+</p>
+!! end
+
+!! test
+Internal link with ca linktrail, surrounded by italic apostrophes (bug 27473 primary issue)
+!! options
+language=ca
+!! input
+''[[Main Page]]''
+!! result
+<p><i><a href="/wiki/Main_Page">Main Page</a></i>
+</p>
+!! end
+
+!! test
+Internal link with en linktrail: no apostrophes (bug 27473)
+!! options
+language=en
+!! input
+[[Something]]'nice
+!! result
+<p><a href="/index.php?title=Something&action=edit&redlink=1" class="new" title="Something (page does not exist)">Something</a>'nice
+</p>
+!! end
+
+!! test
+Internal link with ca linktrail with apostrophes (bug 27473)
+!! options
+language=ca
+!! input
+[[Something]]'nice
+!! result
+<p><a href="/index.php?title=Something&action=edit&redlink=1" class="new" title="Something (encara no existeix)">Something'nice</a>
+</p>
+!! end
+
+!! test
+Internal link with kaa linktrail with apostrophes (bug 27473)
+!! options
+language=kaa
+!! input
+[[Something]]'nice
+!! result
+<p><a href="/index.php?title=Something&action=edit&redlink=1" class="new" title="Something (bet ele jaratılmag'an)">Something'nice</a>
+</p>
+!! end
###
### Interwiki links (see maintenance/interwiki.sql)