@atlaskit/editor-plugin-show-diff
Version:
ShowDiff plugin for @atlaskit/editor-core
13 lines (12 loc) • 761 B
TypeScript
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
/**
* Looser equality for "safe diff" cases: same full text content and same block structure
* (e.g. text moved across text-node boundaries). Used when strict areNodesEqualIgnoreAttrs fails.
* This is safe because we ensure decorations get applied to valid positions.
*
* Marks are intentionally ignored — two documents that differ only in mark application
* (e.g. bold/italic boundaries or annotation mark ordering) are considered equal here.
* Both documents are mark-stripped before comparison so that mark-driven text fragmentation
* does not produce false inequalities.
*/
export declare function areDocsEqualByBlockStructureAndText(doc1: PMNode, doc2: PMNode): boolean;