Index: trunk/parsers/wikidom/lib/es/es.Content.js |
— | — | @@ -71,6 +71,17 @@ |
72 | 72 | };
|
73 | 73 |
|
74 | 74 | Content.prototype.insert = function( start, insert ) {
|
| 75 | + // TODO: Prefer to not take annotations from a neighbor that's a space character
|
| 76 | + var neighbor = this.data[Math.max( start - 1, 0 )];
|
| 77 | + if ( $.isArray( neighbor ) ) {
|
| 78 | + var annotations = neighbor.slice( 1 );
|
| 79 | + for ( var i = 0; i < insert.length; i++ ) {
|
| 80 | + if ( typeof insert[i] === 'string' ) {
|
| 81 | + insert[i] = [insert[i]];
|
| 82 | + }
|
| 83 | + insert[i] = insert[i].concat( annotations );
|
| 84 | + }
|
| 85 | + }
|
75 | 86 | Array.prototype.splice.apply( this.data, [start, 0].concat( insert ) )
|
76 | 87 | };
|
77 | 88 |
|