MCPcopy
hub / github.com/marktext/marktext / appendChild

Method appendChild

packages/muyajs/lib/contentState/index.js:654–666  ·  view source on GitHub ↗
(parent, block)

Source from the content-addressed store, hash-verified

652 }
653
654 appendChild(parent, block) {
655 const len = parent.children.length
656 const lastChild = parent.children[len - 1]
657 parent.children.push(block)
658 block.parent = parent.key
659 if (lastChild) {
660 lastChild.nextSibling = block.key
661 block.preSibling = lastChild.key
662 } else {
663 block.preSibling = null
664 }
665 block.nextSibling = null
666 }
667
668 replaceBlock(newBlock, oldBlock) {
669 const blockList = oldBlock.parent ? this.getParent(oldBlock).children : this.blocks

Callers 15

createBlockPMethod · 0.95
syncLineNumbersSpansFunction · 0.80
insertAfterFunction · 0.80
renderHtmlMethod · 0.80
makeMuyaFunction · 0.80
loadImageAsyncFunction · 0.80
runLoadFunction · 0.80
mouseOverMethod · 0.80
constructorMethod · 0.80
initFunction · 0.80
constructorMethod · 0.80

Calls 1

pushMethod · 0.80

Tested by 6

makeMuyaFunction · 0.64
runLoadFunction · 0.64
makeFakeMuyaFunction · 0.64
makeFakeMuyaFunction · 0.64
bootMuyaFunction · 0.64
bootMuyaFunction · 0.64