(document, range)
| 70 | } |
| 71 | |
| 72 | insertDocumentAtRange(document, range) { |
| 73 | const { blockList } = document |
| 74 | range = normalizeRange(range) |
| 75 | let [ position ] = range |
| 76 | const { index, offset } = this.locationFromPosition(position) |
| 77 | |
| 78 | let result = this |
| 79 | const block = this.getBlockAtPosition(position) |
| 80 | |
| 81 | if (rangeIsCollapsed(range) && block.isEmpty() && !block.hasAttributes()) { |
| 82 | result = new this.constructor(result.blockList.removeObjectAtIndex(index)) |
| 83 | } else if (block.getBlockBreakPosition() === offset) { |
| 84 | position++ |
| 85 | } |
| 86 | |
| 87 | result = result.removeTextAtRange(range) |
| 88 | return new this.constructor(result.blockList.insertSplittableListAtPosition(blockList, position)) |
| 89 | } |
| 90 | |
| 91 | mergeDocumentAtRange(document, range) { |
| 92 | let formattedDocument, result |
no test coverage detected