mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
Support for nodes that handles their own children in ve.dm.Converter.prototype.getDomSubtreeFromData
Change-Id: I784dec71d3f0b23001075234e324a8e06a6cfc6b
This commit is contained in:
parent
57a2de90aa
commit
531c049679
|
@ -921,6 +921,7 @@ ve.dm.Converter.prototype.getDomSubtreeFromData = function ( data, container ) {
|
|||
var dataSlice, j, depth,
|
||||
handlesOwn = false;
|
||||
|
||||
// TODO: Shouldn't be implemented with try..catch cause it makes debugging harder and sacrifice performance.
|
||||
try {
|
||||
handlesOwn = ve.dm.nodeFactory.doesNodeHandleOwnChildren( data[i].type );
|
||||
} catch ( e ) {}
|
||||
|
@ -1225,6 +1226,17 @@ ve.dm.Converter.prototype.getDomSubtreeFromData = function ( data, container ) {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
// In case of nodes that handles own children ascend to parent node.
|
||||
// It looks like the solution would be to avoid descending first ( so ascending
|
||||
// wouldn't be needed ) but note that then code above for handling white spaces
|
||||
// wouldn't execute correctly.
|
||||
// TODO: Shouldn't be implemented with try..catch cause it makes debugging harder and sacrifice performance.
|
||||
try {
|
||||
if ( ve.dm.nodeFactory.doesNodeHandleOwnChildren( data[i].type ) ) {
|
||||
domElement = parentDomElement;
|
||||
}
|
||||
} catch ( e ) {}
|
||||
}
|
||||
|
||||
if ( ve.isArray( dataElementOrSlice ) ) {
|
||||
|
|
Loading…
Reference in a new issue