Fix treatment of elements in addAnnotationsToData()

It should skip annotating elements, but doesn't.

Change-Id: I28fa83832748eb76fa9238e52074bb785ab1cf49
This commit is contained in:
Roan Kattouw 2013-06-27 14:43:32 -07:00 committed by Esanders
parent 01e1cb1e71
commit 52f4711f4a

View file

@ -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() );
}