* (bug 40214) Category pages no longer use deprecated "width" HTML attribute.
* (bug 39941) Add missing stylesheets to the installer pages
* In HTML5 mode, allow new input element types values (such as color, range..)
+* (bug 36151) mw.Title: Don't limit extension in title parsing.
=== API changes in 1.20 ===
* (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API.
setAll = function ( title, s ) {
// In normal browsers the match-array contains null/undefined if there's no match,
// IE returns an empty string.
- var matches = s.match( /^(?:([^:]+):)?(.*?)(?:\.(\w{1,5}))?$/ ),
+ var matches = s.match( /^(?:([^:]+):)?(.*?)(?:\.(\w+))?$/ ),
ns_match = getNsIdByName( matches[1] );
// Namespace must be valid, and title must be a non-empty string.
setNameAndExtension = function ( title, raw ) {
// In normal browsers the match-array contains null/undefined if there's no match,
// IE returns an empty string.
- var matches = raw.match( /^(?:)?(.*?)(?:\.(\w{1,5}))?$/ );
+ var matches = raw.match( /^(?:)?(.*?)(?:\.(\w+))?$/ );
// Title must be a non-empty string.
if ( typeof matches[1] === 'string' && matches[1] !== '' ) {
assert.equal( title.toText(), title.getPrefixedText() );
});
-QUnit.test( 'Exists', 3, function ( assert ) {
+QUnit.test( 'getExtension', 7, function ( assert ) {
+
+ function extTest( pagename, ext, description ) {
+ var title = new mw.Title( pagename );
+ assert.equal( title.getExtension(), ext, description || pagename );
+ }
+
+ extTest( 'MediaWiki:Vector.js', 'js' );
+ extTest( 'User:Example/common.css', 'css' );
+ extTest( 'File:Example.longextension', 'longextension', 'Extension parsing not limited (bug 36151)' );
+ extTest( 'Example/information.json', 'json', 'Extension parsing not restricted from any namespace' );
+ extTest( 'Foo.', null, 'Trailing dot is not an extension' );
+ extTest( 'Foo..', null, 'Trailing dots are not an extension' );
+ extTest( 'Foo.a.', null, 'Page name with dots and ending in a dot does not have an extension' );
+
+ // @broken: Throws an exception
+ // extTest( '.NET', null, 'Leading dot is (or is not?) an extension' );
+});
+
+QUnit.test( 'exists', 3, function ( assert ) {
var title;
// Empty registry, checks default to null
});
-QUnit.test( 'Url', 2, function ( assert ) {
+QUnit.test( 'getUrl', 2, function ( assert ) {
var title;
// Config