jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/350065 )
Change subject: WikitextSerializer: Handle new TemplateData API option
......................................................................
WikitextSerializer: Handle new TemplateData API option
Change-Id: Ib881e0df9178b873291b8dfff8a4542749298765
---
M lib/html2wt/WikitextSerializer.js
M lib/mw/ApiRequest.js
2 files changed, 6 insertions(+), 0 deletions(-)
Approvals:
Subramanya Sastry: Looks good to me, approved
jenkins-bot: Verified
diff --git a/lib/html2wt/WikitextSerializer.js
b/lib/html2wt/WikitextSerializer.js
index f93ddef..0c3dd2f 100644
--- a/lib/html2wt/WikitextSerializer.js
+++ b/lib/html2wt/WikitextSerializer.js
@@ -655,6 +655,11 @@
var tplData = null;
return p.then(function(apiResp) {
tplData = apiResp && apiResp[Object.keys(apiResp)[0]];
+ // If the template doesn't exist, or does but has no
TemplateData,
+ // ignore it
+ if (tplData && (tplData.missing ||
tplData.notemplatedata)) {
+ tplData = null;
+ }
fetched = true;
return self.serializePart(node, type, tpl, tplData);
}).catch(function(err) {
diff --git a/lib/mw/ApiRequest.js b/lib/mw/ApiRequest.js
index e064ade..afd9b40 100644
--- a/lib/mw/ApiRequest.js
+++ b/lib/mw/ApiRequest.js
@@ -1108,6 +1108,7 @@
var apiargs = {
format: 'json',
action: 'templatedata',
+ doNotIgnoreMissingTitles: '1',
titles: template,
};
--
To view, visit https://gerrit.wikimedia.org/r/350065
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib881e0df9178b873291b8dfff8a4542749298765
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
Gerrit-Reviewer: C. Scott Ananian <[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