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

Method copyWithBaseBlockAttributes

src/trix/models/document.js:55–62  ·  view source on GitHub ↗
(blockAttributes = [])

Source from the content-addressed store, hash-verified

53 }
54
55 copyWithBaseBlockAttributes(blockAttributes = []) {
56 const blocks = this.getBlocks().map((block) => {
57 const attributes = blockAttributes.concat(block.getAttributes())
58 return block.copyWithAttributes(attributes)
59 })
60
61 return new this.constructor(blocks)
62 }
63
64 replaceBlock(oldBlock, newBlock) {
65 const index = this.blockList.indexOf(oldBlock)

Callers 2

mergeDocumentAtRangeMethod · 0.80
trix.jsFile · 0.80

Calls 3

getBlocksMethod · 0.95
getAttributesMethod · 0.45
copyWithAttributesMethod · 0.45

Tested by

no test coverage detected