Skip to content

fix(docx-core): normalize paragraph mark revision reuse#462

Closed
stevenobiajulu wants to merge 3 commits into
mainfrom
452-dedupe-paragraph-mark-ins-20260611
Closed

fix(docx-core): normalize paragraph mark revision reuse#462
stevenobiajulu wants to merge 3 commits into
mainfrom
452-dedupe-paragraph-mark-ins-20260611

Conversation

@stevenobiajulu

@stevenobiajulu stevenobiajulu commented Jun 12, 2026

Copy link
Copy Markdown
Member

Closed in favor of the clean follow-up PR #463.

This PR was opened from the reused #460 branch after #460 squash-merged, so its diff included already-merged pre-squash content. The replacement PR was created from current main and contains only the final follow-up commit.

Whole-paragraph insertion marking could add a second w:ins marker when another path had already placed a paragraph-mark insertion under the paragraph properties. That creates an invalid CT_ParaRPr shape and can also bypass the comparison revision context date and author.

This searches the paragraph properties for an existing paragraph-mark marker before creating one, normalizes its author and date to the active context, and preserves the existing revision id when present. The regression covers the bypass shape and the #452 schema suppression is removed.

Fixes: #452
…rder

The reused paragraph-mark w:ins kept its legacy mid-sequence position, and
a newly created w:del was always prepended even ahead of an existing w:ins,
so the emitted-schema gate flagged w:ins after w:del/formatting children.
CT_ParaRPr requires the tracked-change group (w:ins, w:del, w:moveFrom,
w:moveTo) first and in that order.

- addParagraphMarkRevisionMarker now routes both reused and new markers
  through placeParagraphMarkRevisionMarker: w:ins goes first in rPr, w:del
  goes right after an existing w:ins.
- documentReconstructor.serializePPrWithParaRevisionMarker reuses a marker
  cloned from the source pPr instead of prepending a duplicate (the same
  issue #452 bug class on the reconstruction path), preserving the source
  revision's author/date/id.
Reuse paragraph-mark revision markers across cloned paragraph properties in both in-place and reconstructor paths so CT_ParaRPr ordering remains valid and duplicate insertion markers are not emitted.

Adds regression coverage for reconstructor reuse/ordering and updates the canonical insertion regression to reflect normalized comparison metadata.

Fixes: #452
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
site Ready Ready Preview, Comment Jun 12, 2026 6:54am

Request Review

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant