Pass dataElement type to parent's toDataElement

Ensures the rendering is cached with the correct hash.

Bug: T151130
Depends-On: I80e2f2587cff8e9d9fe6ded5d8581263268deaa8
Change-Id: I64466cc342f7ab7f9d4539f935688d167853a662
This commit is contained in:
Ed Sanders 2017-05-19 16:06:04 +02:00
parent e08865087c
commit 28b480ca0a

View file

@ -37,11 +37,9 @@ ve.dm.MWSyntaxHighlightNode.static.getMatchRdfaTypes = function () {
*/
ve.dm.MWSyntaxHighlightNode.static.toDataElement = function ( domElements, converter ) {
// Parent method
var dataElement = ve.dm.MWExtensionNode.static.toDataElement.call( this, domElements, converter ),
isInline = this.isHybridInline( domElements, converter ),
type = isInline ? 'mwInlineSyntaxHighlight' : 'mwBlockSyntaxHighlight';
dataElement.type = type;
var isInline = this.isHybridInline( domElements, converter ),
type = isInline ? 'mwInlineSyntaxHighlight' : 'mwBlockSyntaxHighlight',
dataElement = ve.dm.MWExtensionNode.static.toDataElement.call( this, domElements, converter, type );
return dataElement;
};