MCPcopy
hub / github.com/basecamp/trix / removeLastTerminalAttributeAtRange

Method removeLastTerminalAttributeAtRange

src/trix/models/document.js:346–359  ·  view source on GitHub ↗
(range)

Source from the content-addressed store, hash-verified

344 }
345
346 removeLastTerminalAttributeAtRange(range) {
347 let { blockList } = this
348 this.eachBlockAtRange(range, function(block, textRange, index) {
349 const lastAttributeName = block.getLastAttribute()
350 if (!lastAttributeName) {
351 return
352 }
353 if (!getBlockConfig(lastAttributeName).terminal) {
354 return
355 }
356 blockList = blockList.editObjectAtIndex(index, () => block.removeAttribute(lastAttributeName))
357 })
358 return new this.constructor(blockList)
359 }
360
361 removeBlockAttributesAtRange(range) {
362 let { blockList } = this

Callers 2

trix.jsFile · 0.80

Calls 5

eachBlockAtRangeMethod · 0.95
getBlockConfigFunction · 0.90
editObjectAtIndexMethod · 0.80
getLastAttributeMethod · 0.45
removeAttributeMethod · 0.45

Tested by

no test coverage detected