mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
Fix treatment of elements in addAnnotationsToData()
It should skip annotating elements, but doesn't. Change-Id: I28fa83832748eb76fa9238e52074bb785ab1cf49
This commit is contained in:
parent
01e1cb1e71
commit
52f4711f4a
|
@ -203,10 +203,15 @@ ve.dm.Document.addAnnotationsToData = function ( data, annotationSet ) {
|
|||
}
|
||||
// Apply annotations to data
|
||||
for ( i = 0, length = data.length; i < length; i++ ) {
|
||||
if ( !ve.isArray( data[i] ) ) {
|
||||
if ( data[i].type ) {
|
||||
// Element
|
||||
continue;
|
||||
} else if ( !ve.isArray( data[i] ) ) {
|
||||
// Wrap in array
|
||||
data[i] = [data[i]];
|
||||
newAnnotationSet = annotationSet.clone();
|
||||
} else {
|
||||
// Add to existing array
|
||||
newAnnotationSet = new ve.dm.AnnotationSet( store, data[i][1] );
|
||||
newAnnotationSet.addSet( annotationSet.clone() );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue