(attributeName, value, range)
| 304 | } |
| 305 | |
| 306 | applyBlockAttributeAtRange(attributeName, value, range) { |
| 307 | const expanded = this.expandRangeToLineBreaksAndSplitBlocks(range) |
| 308 | let document = expanded.document |
| 309 | range = expanded.range |
| 310 | const blockConfig = getBlockConfig(attributeName) |
| 311 | |
| 312 | if (blockConfig.listAttribute) { |
| 313 | document = document.removeLastListAttributeAtRange(range, { exceptAttributeName: attributeName }) |
| 314 | const converted = document.convertLineBreaksToBlockBreaksInRange(range) |
| 315 | document = converted.document |
| 316 | range = converted.range |
| 317 | } else if (blockConfig.exclusive) { |
| 318 | document = document.removeBlockAttributesAtRange(range) |
| 319 | } else if (blockConfig.terminal) { |
| 320 | document = document.removeLastTerminalAttributeAtRange(range) |
| 321 | } else { |
| 322 | document = document.consolidateBlocksAtRange(range) |
| 323 | } |
| 324 | |
| 325 | return document.addAttributeAtRange(attributeName, value, range) |
| 326 | } |
| 327 | |
| 328 | removeLastListAttributeAtRange(range, options = {}) { |
| 329 | let { blockList } = this |
no test coverage detected