jenkins-bot has submitted this change and it was merged.
Change subject: Use the value of the parsoid option for modes
......................................................................
Use the value of the parsoid option for modes
Specific tests can now whitelist what modes to use if they're parsoid-only.
No more need to worry about html2html or html2wt in a lot of cases where we
test for the typeof or about attributes.
Change-Id: Iab2f13ec0ff4410dc812ac8a0c101d53dbdb3661
---
M js/tests/parserTests.js
1 file changed, 25 insertions(+), 2 deletions(-)
Approvals:
Cscott: Looks good to me, approved
jenkins-bot: Verified
diff --git a/js/tests/parserTests.js b/js/tests/parserTests.js
index 4c671e1..b24c775 100755
--- a/js/tests/parserTests.js
+++ b/js/tests/parserTests.js
@@ -1477,7 +1477,7 @@
* @method
*/
ParserTests.prototype.processCase = function ( i, options ) {
- var item, cases = this.cases;
+ var ix, item, cases = this.cases, targetModes = options.modes;
var nextCallback = this.processCase.bind( this, i + 1, options );
@@ -1512,7 +1512,30 @@
// Add comments to following test.
item.comments = item.comments ||
this.comments;
this.comments = [];
- async.series( this.buildTasks( item,
options.modes, options ), nextCallback );
+
+ if ( item.options.parsoid ) {
+ // pegjs parser handles item
options as follows:
+ // item option value
of item.options.parsoid
+ // <none>
undefined
+ // parsoid
""
+ // parsoid=wt2html
"wt2html"
+ // parsoid=wt2html,wt2wt
["wt2html","wt2wt"]
+ if (
item.options.parsoid.constructor !== Array ) {
+ // make a string into a
1-item array
+ item.options.parsoid =
[ item.options.parsoid ];
+ }
+
+ targetModes =
targetModes.filter(function(mode) {
+ return
item.options.parsoid.indexOf( mode ) >= 0;
+ });
+ }
+
+ if ( targetModes.length ) {
+ async.series( this.buildTasks(
item, targetModes, options ), nextCallback );
+ } else {
+ process.nextTick( nextCallback
);
+ }
+
break;
case 'comment':
this.comments.push( item.comment );
--
To view, visit https://gerrit.wikimedia.org/r/61911
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iab2f13ec0ff4410dc812ac8a0c101d53dbdb3661
Gerrit-PatchSet: 10
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: 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