public/vendors~js/chunks/Create~js/chunks/Edit~js/chunks/PostShow~js/chunks/Test.js
// Check whether splitting at the given position is allowed.
Check whether splitting at the given position is allowed.
Check whether splitting at the given position is allowed .
function canSplit(doc, pos, depth, typesAfter) {
  if ( depth === void 0 ) depth = 1;
  var $pos = doc.resolve(pos), base = $pos.depth - depth;
  var innerType = (typesAfter && typesAfter[typesAfter.length - 1]) || $pos.parent;
  if (base < 0 || $pos.parent.type.spec.isolating ||
      !$pos.parent.canReplace($pos.index(), $pos.parent.childCount) ||
      !innerType.type.validContent($pos.parent.content.cutByIndex($pos.index(), $pos.parent.childCount)))
    { return false }
  for (var d = $pos.depth - 1, i = depth - 2; d > base; d--, i--) {
    var node = $pos.node(d), index$1 = $pos.index(d);
    if (node.type.spec.isolating) { return false }
    var rest = node.content.cutByIndex(index$1, node.childCount);
    var after = (typesAfter && typesAfter[i]) || node;
    if (after != node) { rest = rest.replaceChild(0, after.type.create(after.attrs)); }
    if (!node.canReplace(index$1 + 1, node.childCount) || !after.type.validContent(rest))
      { return false }
  }
  var index = $pos.indexAfter(base);
  var baseType = typesAfter && typesAfter[0];
  return $pos.node(base).canReplaceWith(index, index, baseType ? baseType.type : $pos.node(base + 1).type)
}
function canSplit ( doc , pos , depth , typesAfter ) { if ( depth === void 0 ) depth = 1 ; var $pos = doc . resolve ( pos ) , base = $pos . depth - depth ; var innerType = ( typesAfter && typesAfter [ typesAfter . length - 1 ] ) || $pos . parent ; if ( base < 0 || $pos . parent . type . spec . isolating || ! $pos . parent . canReplace ( $pos . index ( ) , $pos . parent . childCount ) || ! innerType . type . validContent ( $pos . parent . content . cutByIndex ( $pos . index ( ) , $pos . parent . childCount ) ) ) { return false } for ( var d = $pos . depth - 1 , i = depth - 2 ; d > base ; d -- , i -- ) { var node = $pos . node ( d ) , index$1 = $pos . index ( d ) ; if ( node . type . spec . isolating ) { return false } var rest = node . content . cutByIndex ( index$1 , node . childCount ) ; var after = ( typesAfter && typesAfter [ i ] ) || node ; if ( after != node ) { rest = rest . replaceChild ( 0 , after . type . create ( after . attrs ) ) ; } if ( ! node . canReplace ( index$1 + 1 , node . childCount ) || ! after . type . validContent ( rest ) ) { return false } } var index = $pos . indexAfter ( base ) ; var baseType = typesAfter && typesAfter [ 0 ] ; return $pos . node ( base ) . canReplaceWith ( index , index , baseType ? baseType . type : $pos . node ( base + 1 ) . type ) }
Check whether splitting at the given position is allowed.
Check whether splitting at the given position is allowed .