mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-13 17:48:17 +00:00
Merge "Handle a further 70 WikiEditor special characters"
This commit is contained in:
commit
2dbe12bc66
|
@ -116,12 +116,15 @@ ve.init.mw.Platform.prototype.fetchSpecialCharList = function () {
|
||||||
var characters = {},
|
var characters = {},
|
||||||
groupObject;
|
groupObject;
|
||||||
$.each( mw.language.specialCharacters, function ( groupName, groupCharacters ) {
|
$.each( mw.language.specialCharacters, function ( groupName, groupCharacters ) {
|
||||||
groupObject = {};
|
groupObject = {}; // key is label, value is char to insert
|
||||||
$.each( groupCharacters, function ( charKey, charVal ) {
|
$.each( groupCharacters, function ( charKey, charVal ) {
|
||||||
|
// VE can only handle replace right now (which is the vast majority of the
|
||||||
|
// entries), not encapsulate.
|
||||||
|
// Can't handle titleMsg either.
|
||||||
if ( typeof charVal === 'string' ) {
|
if ( typeof charVal === 'string' ) {
|
||||||
// VE can only handle the strings right now
|
|
||||||
// (which is the vast majority of the entries)
|
|
||||||
groupObject[charVal] = charVal;
|
groupObject[charVal] = charVal;
|
||||||
|
} else if ( typeof charVal === 'object' && 0 in charVal && 1 in charVal ) {
|
||||||
|
groupObject[charVal[0]] = charVal[1];
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
characters[mw.msg( 'special-characters-group-' + groupName )] = groupObject;
|
characters[mw.msg( 'special-characters-group-' + groupName )] = groupObject;
|
||||||
|
|
Loading…
Reference in a new issue