mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
Shallow-copy annotation objects in HTMLConverter
This fixes an annotation contamination issue that was causing Rob's tests to throw exceptions Change-Id: Ic5171d600b0b2ff97cc569e1e6f9488fab177c7c
This commit is contained in:
parent
e524152319
commit
ae3d31d447
|
@ -178,7 +178,9 @@ ve.dm.HTMLConverter.generateAnnotatedContent = function( content, annotations )
|
|||
annotationMap[ve.getHash( annotations[i] )] = annotations[i];
|
||||
}
|
||||
for ( i = 0; i < characters.length; i++ ) {
|
||||
characters[i] = [characters[i], annotationMap];
|
||||
// Make a shallow copy of the annotationMap object, otherwise adding an annotation
|
||||
// to one character automatically adds it to all of others as well
|
||||
characters[i] = [characters[i], ve.extendObject( {}, annotationMap )];
|
||||
}
|
||||
return characters;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue