Subramanya Sastry has submitted this change and it was merged.
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
M js/lib/mediawiki.wikitext.constants.js
2 files changed, 15 insertions(+), 3 deletions(-)
Approvals:
Subramanya Sastry: Verified; Looks good to me, approved
jenkins-bot: Verified
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, '(.*)' );
diff --git a/js/lib/mediawiki.wikitext.constants.js
b/js/lib/mediawiki.wikitext.constants.js
index 21abe08..c1fd321 100644
--- a/js/lib/mediawiki.wikitext.constants.js
+++ b/js/lib/mediawiki.wikitext.constants.js
@@ -55,7 +55,10 @@
'img_border' : 'border',
'img_frameless' : 'format',
'img_framed' : 'format',
- 'img_thumbnail' : 'format'
+ 'img_thumbnail' : 'format',
+
+ // Ha! Upright can be either one! Try parsing THAT!
+ 'img_upright' : 'upright'
}
},
--
To view, visit https://gerrit.wikimedia.org/r/56063
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Icfe1b9a7b4352e018a8818e213fb454a9656c5f2
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits