Skip to content

fix(markdown): apply document edits deterministically - #2967

Draft
George Ng (GeorgeNgMsft) wants to merge 1 commit into
georgengmsft-markdown-workspace-createfrom
georgengmsft-markdown-safe-updates
Draft

fix(markdown): apply document edits deterministically#2967
George Ng (GeorgeNgMsft) wants to merge 1 commit into
georgengmsft-markdown-workspace-createfrom
georgengmsft-markdown-safe-updates

Conversation

@GeorgeNgMsft

Copy link
Copy Markdown
Contributor

Summary

Layer 2 of the replacement stack for #2940, inserted to keep the stack reviewable.

  • apply Markdown operations against stable base-relative character offsets
  • preserve deterministic source order for inserts at the same position
  • reject overlapping and out-of-range operations
  • serialize Markdown content nodes and support adding/removing strong, emphasis, code, and link marks
  • correctly remove link marks with balanced parentheses only when the destination matches

Deferred to higher layers

Durable workspace persistence, revision and binding conflict checks, streaming persistence, view-service state, browser synchronization/autosave, same-file editor rebinding, and loopback-only binding remain intentionally deferred.

Validation

  • cached TypeScript 5.4.5 strict no-emit check: passed for markdownOperationSchema.ts and documentOperations.ts
  • direct compiled smoke tests: passed for base-relative edits, same-position inserts, overlap rejection, mark add/remove, balanced-parenthesis links, and mismatched-link preservation
  • cached Prettier 3.5.3 changed-file check: passed
  • git diff --check: passed
  • focused review: fixed link removal corruption for parenthesized or mismatched destinations

The normal package build/Jest suite and PR ratchets could not run because this worktree had no node_modules; the single time-boxed cached/offline restore did not complete and attempted unavailable Azure feed artifacts. The commit hook was therefore bypassed after the equivalent cached Prettier/type/smoke checks above.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant