mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 03:08:42 +00:00
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:
parent
cec798558a
commit
aede27fbd8
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue