From aede27fbd80938d1f797f12f1ca52d1d2e800e23 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Sun, 5 Jan 2014 13:05:59 +0800 Subject: [PATCH] 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 --- modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js b/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js index e504d2ba51..0ac5ade3a1 100644 --- a/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js +++ b/modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js @@ -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

s, and inline templates // will render strangely when wrapped in

s.