Index: trunk/extensions/VisualEditor/modules/es/models/es.DocumentModel.js |
— | — | @@ -618,7 +618,7 @@ |
619 | 619 | * @method |
620 | 620 | * @param {es.DocumentModelNode} node Node to get element data for |
621 | 621 | */ |
622 | | -es.DocumentModel.prototype.getContentDataFromNode = function( node ) { |
| 622 | +es.DocumentModel.prototype.getElementDataFromNode = function( node ) { |
623 | 623 | var length = node.getElementLength(); |
624 | 624 | var offset = this.getOffsetFromNode( node ); |
625 | 625 | if ( offset !== -1 ) { |
— | — | @@ -652,7 +652,9 @@ |
653 | 653 | } |
654 | 654 | var offset = this.getOffsetFromNode( node ); |
655 | 655 | if ( offset !== -1 ) { |
656 | | - offset++; |
| 656 | + if ( node.type !== 'document' ) { |
| 657 | + offset++; |
| 658 | + } |
657 | 659 | return this.data.slice( offset + range.start, offset + range.end ); |
658 | 660 | } |
659 | 661 | return null; |