Alex Monk has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/200504

Change subject: Handle a further 70 WikiEditor special characters
......................................................................

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
---
M modules/ve-mw/init/ve.init.mw.Platform.js
1 file changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/04/200504/1

diff --git a/modules/ve-mw/init/ve.init.mw.Platform.js 
b/modules/ve-mw/init/ve.init.mw.Platform.js
index a732a4a..ab68e06 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 @@
        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;

-- 
To view, visit https://gerrit.wikimedia.org/r/200504
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7c0fa06b1c873ab286cffb7a83016a2d37ab744
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <kren...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to