jenkins-bot has submitted this change and it was merged.
Change subject: Drop bad ext. HTML and continue html2wt instead of returning
HTTP 500
......................................................................
Drop bad ext. HTML and continue html2wt instead of returning HTTP 500
* On occasion, because of client bugs, we get <ref> tags that cannot
be serialized properly (see T110479).
* Instead of refusing to serialize the rest of the page, just drop
such extensions on the floor and continue with the rest of the page.
This at least prevents users from losing rest of their work because
of failures to save the page.
Change-Id: I3dd4b25c6ddbd77246871aa773f299e3a894d7ae
---
M lib/mediawiki.WikitextSerializer.js
1 file changed, 6 insertions(+), 5 deletions(-)
Approvals:
Arlolra: Looks good to me, approved
Jforrester: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/lib/mediawiki.WikitextSerializer.js
b/lib/mediawiki.WikitextSerializer.js
index 37b6ab6..53ea27d 100644
--- a/lib/mediawiki.WikitextSerializer.js
+++ b/lib/mediawiki.WikitextSerializer.js
@@ -623,11 +623,12 @@
extraDebug = '
[reference ' + href + ' not found]';
}
}
- // Bail out of here since we cannot
meaningfully recover
- // from this without losing content and
corrupting the page.
- state.env.log("fatal/request",
- "extension src id " +
dataMW.body.id + " points to non-existent element for: ",
- node.outerHTML + extraDebug);
+
+ // Log an error and drop the extension
call
+ state.env.log("error/" + extName,
+ "extension src id " +
dataMW.body.id + " points to non-existent element for:",
+ node.outerHTML, ". Dropping the
extension. More debug info: ", extraDebug);
+ return '';
}
}
if (htmlText) {
--
To view, visit https://gerrit.wikimedia.org/r/234333
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3dd4b25c6ddbd77246871aa773f299e3a894d7ae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: Jforrester <[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