Index: trunk/parsers/wikidom/lib/es/es.Content.js |
— | — | @@ -195,10 +195,23 @@ |
196 | 196 | for ( var i = start; i < end; i++ ) {
|
197 | 197 | switch ( annotation.method ) {
|
198 | 198 | case 'add':
|
| 199 | + var duplicate = false;
|
199 | 200 | if ( typeof this.data[i] === 'string' ) {
|
200 | 201 | this.data[i] = [this.data[i]];
|
| 202 | + } else {
|
| 203 | + for ( var j = 1; j < this.data[i].length; j++ ) {
|
| 204 | + if ( this.data[i][j].type === annotation.type
|
| 205 | + && Content.compareObjects(
|
| 206 | + this.data[i][j].data, annotation.data
|
| 207 | + )
|
| 208 | + ) {
|
| 209 | + duplicate = true;
|
| 210 | + }
|
| 211 | + }
|
201 | 212 | }
|
202 | | - this.data[i].push( annotation );
|
| 213 | + if ( !duplicate ) {
|
| 214 | + this.data[i].push( annotation );
|
| 215 | + }
|
203 | 216 | break;
|
204 | 217 | case 'remove':
|
205 | 218 | if ( typeof this.data[i] !== 'string' ) {
|