Skip to content

Nested tracked marks and invalid change ranges when typing inside deletions #79

Description

@Madhawa97

Typing inside deleted text (e.g. insert "AB" into deleted region) can produce nested tracked marks and invalid change ranges. Symptoms include nested <ins>/<del> marks (nested marks or the actual issue is not immediately visible as we use excludes: 'tracked_insert tracked_delete', in the schema.

Image

Steps to reproduce:

  1. Open a document with tracked deletion covering a word/phrase.
  2. Place cursor inside that deleted text and type two characters (e.g. "AB").
  3. Observe resulting DOM/marks

Observed the same behavior with apps created using @handlewithcare/react-prosemirror and regular ProseMirror libraries

Actual:

  • Insert and delete marks become nested or overlapped (e.g. ABample text).
  • fixInconsistentChanges runs and applies marks using stale positions, producing invalid change ranges and warnings.

Expected:

  • New inserted characters become a separate, correct insert change (e.g. AB) adjacent to deletes.

Root cause:

fixInconsistentChanges was using a changeSet built before mergeTrackedMarks ran, so it operated on stale change metadata and attempted fixes with outdated ranges.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions