Skip to content

fix(comparer): Add SimplifyMoveMarkup setting for Word compatibility (Issue #96)#97

Merged
JSv4 merged 3 commits intomainfrom
feature/issue-96-simplify-move-markup
Jan 21, 2026
Merged

fix(comparer): Add SimplifyMoveMarkup setting for Word compatibility (Issue #96)#97
JSv4 merged 3 commits intomainfrom
feature/issue-96-simplify-move-markup

Conversation

@JSv4
Copy link
Copy Markdown
Owner

@JSv4 JSv4 commented Jan 21, 2026

Summary

  • Add SimplifyMoveMarkup setting to convert native move markup (w:moveFrom/w:moveTo) to simple w:del/w:ins for Word compatibility
  • Change DetectMoves default from true to false until Phase II fixes the underlying ID collision bug
  • Phase I workaround for Issue Move operations cause Word 'unreadable content' warning #96: Move operations cause Word "unreadable content" warning

Root Cause Analysis

The underlying bug is in FixUpRevMarkIds() which runs AFTER FixUpRevisionIds() and overwrites w:del/w:ins IDs starting from 0, causing collisions with move element IDs. This will be fixed in Phase II.

Changes

  • WmlComparerSettings: Added SimplifyMoveMarkup (default: false), changed DetectMoves default to false
  • SimplifyMoveMarkupToDelIns(): New method that converts move markup to del/ins
  • Documentation: Updated CHANGELOG.md and CLAUDE.md with warnings and usage guidance
  • Tests: 7 new tests covering SimplifyMoveMarkup functionality

Usage

For users who need move detection with Word compatibility:

var settings = new WmlComparerSettings
{
    DetectMoves = true,
    SimplifyMoveMarkup = true  // Converts moves to del/ins for Word compatibility
};

Test plan

  • All 7 new SimplifyMoveMarkup tests pass
  • Full test suite passes (1185 passed, 0 failed, 1 skipped)
  • Manual verification: Compare documents with moves, open in Word without warnings

Fixes #96 (Phase I)

JSv4 added 3 commits January 20, 2026 15:32
…default

- Add SimplifyMoveMarkup setting to convert move markup (w:moveFrom/w:moveTo)
  to simple del/ins markup for Word compatibility (Issue #96 workaround)
- Change DetectMoves default from true to false until Phase II fixes the
  underlying ID collision bug in FixUpRevMarkIds
- Add SimplifyMoveMarkupToDelIns() method that:
  - Converts w:moveFrom to w:del
  - Converts w:moveTo to w:ins
  - Removes all move range markers
- Add docs/plans/ to .gitignore for internal working documents

Addresses Issue #96: Move operations cause Word 'unreadable content' warning
- Add Issue #96 fix to CHANGELOG under [Unreleased] Fixed section
- Update WmlComparerSettings documentation in CLAUDE.md:
  - Change DetectMoves default from true to false
  - Add SimplifyMoveMarkup setting
  - Add warning about known move detection issue
- Add 6 new tests for SimplifyMoveMarkup functionality:
  - SimplifyMoveMarkup_ShouldConvertMoveFromToDel
  - SimplifyMoveMarkup_ShouldConvertMoveToToIns
  - SimplifyMoveMarkup_ShouldRemoveRangeMarkers
  - SimplifyMoveMarkup_ShouldPreserveAttributes
  - SimplifyMoveMarkup_WhenFalse_ShouldPreserveMoveElements
  - DetectMoves_ShouldDefaultToFalse
  - SimplifyMoveMarkup_ShouldDefaultToFalse
- Fix SimplifyMoveMarkupToDelIns call location - must be after
  PutXDocument() so document parts are available for modification
Copy link
Copy Markdown
Owner Author

@JSv4 JSv4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JSv4 JSv4 merged commit ccf4ad1 into main Jan 21, 2026
6 checks passed
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.

Move operations cause Word 'unreadable content' warning

1 participant