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

Method removeLastListAttributeAtRange

src/trix/models/document.js:328–344  ·  view source on GitHub ↗
(range, options = {})

Source from the content-addressed store, hash-verified

326 }
327
328 removeLastListAttributeAtRange(range, options = {}) {
329 let { blockList } = this
330 this.eachBlockAtRange(range, function(block, textRange, index) {
331 const lastAttributeName = block.getLastAttribute()
332 if (!lastAttributeName) {
333 return
334 }
335 if (!getBlockConfig(lastAttributeName).listAttribute) {
336 return
337 }
338 if (lastAttributeName === options.exceptAttributeName) {
339 return
340 }
341 blockList = blockList.editObjectAtIndex(index, () => block.removeAttribute(lastAttributeName))
342 })
343 return new this.constructor(blockList)
344 }
345
346 removeLastTerminalAttributeAtRange(range) {
347 let { blockList } = this

Callers 3

decreaseListLevelMethod · 0.80
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