mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
Merge "Work around $.parseHTML( '' ) returning null"
This commit is contained in:
commit
a84aff99f5
|
@ -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.
|
||||||
|
|
Loading…
Reference in a new issue