Merge "Work around $.parseHTML( '' ) returning null"

This commit is contained in:
jenkins-bot 2015-01-07 20:06:38 +00:00 committed by Gerrit Code Review
commit a84aff99f5

View file

@ -102,7 +102,8 @@ ve.ce.MWTransclusionNode.prototype.onParseSuccess = function ( deferred, respons
return this.onParseError.call( this, deferred ); 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. // 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 // 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. // will render strangely when wrapped in <p>s.