jenkins-bot has submitted this change and it was merged. Change subject: Work around $.parseHTML( '' ) returning null ......................................................................
Work around $.parseHTML( '' ) returning null $.parseHTML() always returns an array, except in this one case, so checking .length of the return value almost always works except when it blows up in your face. Filed upsteam as https://github.com/jquery/jquery/issues/1997 Bug: T86056 Change-Id: If133a9df4d573b41b0ecb5bde47b3e6ada053921 --- M modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js b/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js index 0cece3a..4f7f02f 100644 --- a/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js +++ b/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js @@ -102,7 +102,8 @@ return this.onParseError.call( this, deferred ); } - contentNodes = $.parseHTML( response.visualeditor.content, this.getModelHtmlDocument() ); + // Work around https://github.com/jquery/jquery/issues/1997 + contentNodes = $.parseHTML( response.visualeditor.content, this.getModelHtmlDocument() ) || []; // HACK: if $content consists of a single paragraph, unwrap it. // We have to do this because the PHP parser wraps everything in <p>s, and inline templates // will render strangely when wrapped in <p>s. -- To view, visit https://gerrit.wikimedia.org/r/183309 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If133a9df4d573b41b0ecb5bde47b3e6ada053921 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Catrope <[email protected]> Gerrit-Reviewer: Krinkle <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
