fix(docx-creator): fix Word Compatibility Mode + ECMA-376 ordering bugs - #286
Merged
Merged
Conversation
Generated docx files opened in real Microsoft Word (not LibreOffice) in Compatibility Mode with phantom bullet markers scattered across paragraphs that were never given any numbering. Root cause: the generator's document lacked a DocumentSettingsPart (settings.xml) declaring compatibilityMode, so Word fell back to legacy rendering. Fixed alongside a related but separate issue found while diagnosing it: RunProperties/ParagraphProperties/ TableProperties child elements were appended in the wrong order relative to ECMA-376's required sequence — this validates as PASSED under minimax-docx's own XSD-based `validate` CLI (which doesn't check element ordering) but fails 59-79 checks under the OpenXML SDK's own OpenXmlValidator, and is a separate defect class from the Compatibility Mode one (fixing one alone does not fix the other). Independently re-verified by a fresh-context reviewer agent (own repro, own throwaway OpenXmlValidator, own Word open/close test) before this PR. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VuCifi4WbRxkdZqQw3kqc1
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.
Summary
Program.csopened in real Microsoft Word in Compatibility Mode, with phantom bullet-like markers on paragraphs that were never given any numbering. Root cause: the generated package lacked aDocumentSettingsPart(settings.xml) declaringcompatibilityMode, so Word fell back to legacy rendering rules.RunProperties/ParagraphProperties/TablePropertieschild elements were appended out of ECMA-376's required order (e.g.coloraftersz,numPrafterjc/spacing).minimax-docx's ownvalidateCLI reportsPASSEDon files with this defect (it's an XSD validator, doesn't check element ordering) — the OpenXML SDK's ownOpenXmlValidatorcatches it (59–79 errors on a real test doc). Fixing the ordering alone does not fix the Compatibility Mode issue and vice versa — they're independent root causes, both now fixed.StyleDefinitionsPart+DocumentSettingsPart, fixed a missing requiredw:tblGridon non-signature tables, documented both as ISSUE-012/ISSUE-013 inknown_issues.md, added a mandatory "open in real Word" verification step (Step 3a) since LibreOffice cannot see this defect class at all.SKILL.md,scripts/README.md,known_issues.md) to function/case-name references, since this change's ~44-line growth inProgram.cshad already silently invalidated some of them — line numbers drift, names don't.How this was verified
OpenXmlValidator(FileFormatVersions.Office2013): 0 errors after fix (was 59–79 depending on test doc).Microsoft Word.app: the title bar's "兼容性模式" suffix disappears, table borders/column widths render correctly.OpenXmlValidator, own Word open/close test) rather than trusting this session's own checks — confirmed the same before/after counts on its own test doc.skill-creator'saudit_skill_regressionpipeline (snapshot → compare → classify → verify) against the pre-change skill bundle; all pre-existing documented behavior (alignment layering, per-list numbering restart, CJK dual-slot fonts, six-border tables, empty-header-row skip) re-verified working unchanged.quick_validateandsecurity_scanboth pass.Test plan
OpenXmlValidatorclean (0 errors)security_scan/quick_validatepass🤖 Generated with Claude Code