Fix duplicated, misordered and truncated Word/Powerpoint snapshots#140
Merged
SimonCropp merged 4 commits intoJul 10, 2026
Merged
Conversation
RegisterFileConverter<T> and RegisterStreamConverter(ext) were both pointed at the same Convert* method. Verify runs the extension stream converter over the package target a file converter returns, so verifying a typed document (WordprocessingDocument, SpreadsheetDocument, PresentationDocument) ran the whole extraction twice and wrote the info, the text and the rendered pages to two snapshot files each. A file converter now just hands over the cloned package and lets the extension converter own the extraction, so the typed and stream paths produce byte-identical output. Three further bugs in the Word converter: * The document text was carried in WordInfo.Text and emitted as a txt target, putting it in two snapshots. It is now only the target. Same for PowerpointInfo.Text. * Document order was lost. The walk collected every paragraph then every table, and within a run every text then every tab then every break. It is now a single in-order walk. * Content controls were dropped, so all text inside a w:sdt vanished from the snapshot. SdtBlock, SdtRun, SdtRow and SdtCell are now transparent, matching what Word displays. Hyperlink runs were dropped too. Adds Word tests for ordering, inline/block/in-cell content controls, hyperlinks and interleaved text and tabs. There was no w:sdt coverage, and sample.docx is two bare paragraphs, which is why none of this surfaced. Snapshot churn across 15 tests is mostly filename shift rather than content: the duplicate #00/#1 pairs collapse to a single unsuffixed file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RegisterFileConverter and RegisterStreamConverter(ext) were both pointed at the same Convert* method. Verify runs the extension stream converter over the package target a file converter returns, so verifying a typed document (WordprocessingDocument, SpreadsheetDocument, PresentationDocument) ran the whole extraction twice and wrote the info, the text and the rendered pages to two snapshot files each. A file converter now just hands over the cloned package and lets the extension converter own the extraction, so the typed and stream paths produce byte-identical output.
Three further bugs in the Word converter:
Adds Word tests for ordering, inline/block/in-cell content controls, hyperlinks and interleaved text and tabs. There was no w:sdt coverage, and sample.docx is two bare paragraphs, which is why none of this surfaced.
Snapshot churn across 15 tests is mostly filename shift rather than content: the duplicate #00/#1 pairs collapse to a single unsuffixed file.