This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Helper for iterating through the nodes in a document that changed compared | |
| * to the given previous document. Useful for avoiding duplicate work on each transaction. | |
| * Source: https://github.com/ProseMirror/prosemirror-tables/blob/master/src/fixtables.js | |
| */ | |
| import type { Node as PMNode } from "prosemirror-model" | |
| export function changedDescendants(old: PMNode, cur: PMNode, offset: number, f: (node: PMNode, pos: number) => void) { | |
| let oldSize = old.childCount, curSize = cur.childCount | |
| outer: for (let i = 0, j = 0; i < curSize; i++) { |
OlderNewer