diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js b/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js index 0cece3a6ce..4f7f02f81f 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 @@ ve.ce.MWTransclusionNode.prototype.onParseSuccess = function ( deferred, respons 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
s, and inline templates // will render strangely when wrapped in
s.