MarkTraceur has uploaded a new change for review.

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


Change subject: Fix another image regression
......................................................................

Fix another image regression

Since 'upright' can have a value or not, the non-value version
was getting picked up by the interpolated regex. So I had to
separated the two lists of options explicitly, and in another form
than what we already had.

Change-Id: Icfe1b9a7b4352e018a8818e213fb454a9656c5f2
---
M js/lib/mediawiki.WikiConfig.js
1 file changed, 11 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid 
refs/changes/63/56063/1

diff --git a/js/lib/mediawiki.WikiConfig.js b/js/lib/mediawiki.WikiConfig.js
index cbc8ab4..f08461f 100644
--- a/js/lib/mediawiki.WikiConfig.js
+++ b/js/lib/mediawiki.WikiConfig.js
@@ -91,6 +91,7 @@
                aliases = mw.aliases;
                if ( aliases.length > 0 ) {
                        conf.mwAliases[mw.name] = [];
+                       conf.interpolatedAliases[mw.name] = [];
                }
                for ( var mwax = 0; mwax < aliases.length; mwax++ ) {
                        var alias = aliases[mwax];
@@ -102,6 +103,7 @@
                                // This is a named option. Add it to the array.
                                namedMagicOptions.push( alias.replace( 
replaceRegex, '(.*)' ) );
                                conf.interpolatedList.push( alias );
+                               conf.interpolatedAliases[mw.name].push( alias );
                        }
                        conf.magicWords[alias] = mw.name;
                        conf.mwAliases[mw.name].push( alias );
@@ -279,10 +281,16 @@
        extensionTags: null,
 
        /**
-        * @property {Object/null} interpolatedList List of magic words that 
are interpolated, i.e., they have $1 in their aliases.
+        * @property {Array/null} interpolatedList List of magic words that are 
interpolated, i.e., they have $1 in their aliases.
         * @private
         */
        interpolatedList: null,
+
+       /**
+        * @property {Object/null} interpolatedAliases List of magic word 
aliases with $1 in their names, indexed by canonical name.
+        * @private
+        */
+       interpolatedAliases: null,
 
        /**
         * @property {string[]}
@@ -310,6 +318,7 @@
                this.specialPages = {};
                this.extensionTags = {};
                this.interpolatedList = [];
+               this.interpolatedAliases = {};
                this._protocols = {};
                // clone the canonicalNamespace list
                this.canonicalNamespaces =
@@ -370,7 +379,7 @@
                        if ( ix > 0 ) {
                                regexString += '|';
                        }
-                       aliases = this.mwAliases[optionsList[ix]];
+                       aliases = this.interpolatedAliases[optionsList[ix]];
                        regexString += aliases.join( '|' )
                                .replace( /((?:^|\|)(?:[^\$]|\$[^1])*)($|\|)/g, 
'$1$$1$2' )
                                .replace( /\$1/g, '(.*)' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icfe1b9a7b4352e018a8818e213fb454a9656c5f2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to