Use $.parseHTML() to parse HTML in the transclusion preview

This fixes the issue where parsing HTML that started with
a text node would cause that first text node to be dropped.

Change-Id: I71dafd69e12cab50e6644b4817f0fd6105657216
This commit is contained in:
Roan Kattouw 2014-01-05 13:05:59 +08:00
parent cec798558a
commit aede27fbd8

View file

@ -93,7 +93,7 @@ ve.ce.MWTransclusionNode.prototype.onParseSuccess = function ( deferred, respons
return this.onParseError.call( this, deferred );
}
contentNodes = this.$( response.visualeditor.content ).get();
contentNodes = $.parseHTML( response.visualeditor.content );
// 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.