Skip to content

fix(doc): recover legacy text box stories - #180

Merged
wybaby168 merged 1 commit into
mainfrom
fix/issue-171-doc-textbox-story
Aug 10, 2026
Merged

fix(doc): recover legacy text box stories#180
wybaby168 merged 1 commit into
mainfrom
fix/issue-171-doc-textbox-story

Conversation

@brownie-cake

Copy link
Copy Markdown
Collaborator

Summary

Fixes #171.

The reported legacy .doc is not suffering from a Chinese code-page failure. Its main Word story contains 22 0x08 text-box placeholder characters, while the actual resume text is stored in the ccpTxbx text-box story. The parser previously read only ccpText, so those placeholders were rendered as square glyphs.

Changes

  • calculate all legacy Word story ranges from FibRgLw
  • recover ccpTxbx and ccpHdrTxbx text when they contain visible content
  • reuse PAPX/CHPX runs for recovered text-box paragraphs
  • suppress legacy text-box placeholder control characters
  • linearize recovered text-box content after the main story when geometric placement is unavailable
  • convert white text to a readable fallback color in the linearized representation because its original dark shape background is not retained
  • emit MSDOC_TEXTBOX_STORY_LINEARIZED so callers can identify the fidelity fallback
  • add the exact Issue attachment as a regression fixture and wire the regression into root CI

Verification

  • tsc -b packages/renderers/doc/tsconfig.json
  • node packages/renderers/doc/scripts/verify-table-spec.mjs
  • node packages/renderers/doc/scripts/verify-github-34.mjs
  • node packages/renderers/doc/scripts/verify-github-87.mjs
  • node packages/renderers/doc/scripts/verify-github-171.mjs

The reported file now yields 28 visible paragraphs, includes 北京, 求职意向, 教育背景, and 实习经历, contains no U+0008 placeholder glyphs, and produces no invisible white-on-white fallback text.

Fixes #171 by parsing ccpTxbx/ccpHdrTxbx story text, suppressing placeholder control characters, and preserving readable fallback colors. Adds the reported DOC file as a regression fixture.
@wybaby168 wybaby168 added area:word DOC/DOCX/Word rendering status:pr-ready A linked PR passed local review and validation batch:1 First repair batch: validated PRs labels Aug 10, 2026
@wybaby168

wybaby168 commented Aug 10, 2026

Copy link
Copy Markdown
Member

Thanks for the sample-backed fix. The exact fixture, DOC regressions, full demo build, and browser smoke all pass locally; ready after the private-source sync.

@wybaby168
wybaby168 marked this pull request as ready for review August 10, 2026 10:20
@wybaby168
wybaby168 merged commit fc8ed48 into main Aug 10, 2026
1 check passed
@wybaby168
wybaby168 deleted the fix/issue-171-doc-textbox-story branch August 10, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:word DOC/DOCX/Word rendering batch:1 First repair batch: validated PRs status:pr-ready A linked PR passed local review and validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: word文档在线预览乱码

2 participants