Skip to content

fix(doc): omit deleted revision text - #174

Open
HanZephyr wants to merge 1 commit into
firecrawl:mainfrom
HanZephyr:codex/fix-doc-deleted-revisions
Open

HanZephyr wants to merge 1 commit into
firecrawl:mainfrom
HanZephyr:codex/fix-doc-deleted-revisions

Conversation

@HanZephyr

@HanZephyr HanZephyr commented Sep 14, 2026

Copy link
Copy Markdown

Binary Word documents retain text deleted with Track Changes enabled. The DOC parser currently emits that text alongside its replacement, so a replacement such as old -> new becomes oldnew in Markdown. This change omits deleted revision text while retaining insertions and ordinary strikethrough.

Resolve sprmCFRMarkDel in CHPX and piece modifiers, including the Prm0 mapping and the 0x80/0x81 toggle operands. Revision state stays internal to the DOC parser; public models, bindings, dependencies, and lockfiles are unchanged. Deleted ordinary paragraph marks join adjacent text, field delimiters stay balanced, and table cell/row boundaries remain in place. Deleted note references also suppress their note bodies so the renderer cannot emit them as unreferenced notes.

This is deletion-aware text extraction, with table boundaries preserved as documented in the README. It does not accept structural table revisions or edit the source document.

The implementation follows MS-DOC character properties, ToggleOperand, Prm0, and UpxChpx. Revision properties are forbidden in style definitions, so the deletion toggle's style base is the default false.

Validation:

  • Eleven integration tests build synthetic DOC containers in memory and exercise the public conversion API. Ten fail against the original implementation; the table-boundary preservation control passes. All eleven pass with the fix.
  • cargo test --locked: 307 passed, one existing private-corpus test ignored. Existing fixture snapshots are unchanged.
  • cargo fmt --all --check and workspace Clippy with all targets/features and -D warnings: passed.
  • Node release build and npm test: 19 passed; generated bindings unchanged.
  • Python release wheel built and installed into an isolated environment; unittest discovery: 11 passed.
  • Wasm-target Clippy with -D warnings, release build with wasm-pack 0.15.0, and node --test wasm/test.mjs: 8 passed.
  • A private real-world DOC reproduces the original issue against the unchanged base commit. The fixed Rust, Node, Python, and Wasm outputs agree. Its source and extracted text are not included in this PR.

Local validation used Windows x86_64, Rust 1.96.0, Node 25.4.0, and Python 3.13.0. The repository's Linux CI has not been run for this branch yet.

This change was developed and reviewed with AI assistance. Validation commands above were executed locally by the coding agent.


Summary by cubic

Fixes DOC parsing so text deleted with Track Changes is omitted from Markdown output instead of being concatenated with its replacement (old -> new now yields new rather than oldnew). Insertions and ordinary strikethrough are still kept, and table cell/row boundaries remain intact.

  • Resolves the sprmCFRMarkDel toggle in character runs and piece modifiers, including Prm0 mapping and 0x80/0x81 operands.
  • Deleted note references also suppress their note bodies, and deleted field delimiters stay balanced.
  • Adds integration tests covering deletions, toggles, piece modifiers, tables, fields, and notes; existing fixture snapshots are unchanged.

Written for commit 96d5998. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Heads up: you’re close to your flex budget. Increase your flex budget so reviews don’t pause.

Re-trigger cubic

This branch has not been deployed

No deployments
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