From 14d5b4e9301f08442487801d977cc8859bd4bb80 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Mon, 30 Mar 2015 01:27:11 +0100 Subject: [PATCH] Handle a further 70 WikiEditor special characters VE core changes would be needed for the remaining 9. (To deal with 3 titles in the UI, and 6 encapsulating the selected text with one character before and one after). Change-Id: Id7c0fa06b1c873ab286cffb7a83016a2d37ab744 --- modules/ve-mw/init/ve.init.mw.Platform.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/ve-mw/init/ve.init.mw.Platform.js b/modules/ve-mw/init/ve.init.mw.Platform.js index a732a4a961..ab68e06661 100644 --- a/modules/ve-mw/init/ve.init.mw.Platform.js +++ b/modules/ve-mw/init/ve.init.mw.Platform.js @@ -116,12 +116,15 @@ ve.init.mw.Platform.prototype.fetchSpecialCharList = function () { var characters = {}, groupObject; $.each( mw.language.specialCharacters, function ( groupName, groupCharacters ) { - groupObject = {}; + groupObject = {}; // key is label, value is char to insert $.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' ) { - // VE can only handle the strings right now - // (which is the vast majority of the entries) 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;