fix(docx): apply the default paragraph style to pStyle-less paragraphs#315
Merged
Conversation
Paragraphs without an explicit w:pStyle fell back to the synthetic document-default entry, whose paragraph properties are empty — the default style's spacing and line spacing (normally Normal, marked w:default="1") were dropped, compressing the page body. Fold the default paragraph style into the doc-default cascade entry so the full chain (document defaults → default style → explicit style → direct formatting) resolves. Upstream fork fix: developer0hye/docx-rs@e483367 reads and writes the style default attribute, which the library previously dropped. Related: #288 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
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
w:pStylefell back to the synthetic doc-default entry with empty paragraph properties, dropping the default style's spacing/line spacing and compressing the page bodyw:default="1"paragraph style into the doc-default cascade entry so the full chain (document defaults → default style → explicit style → direct formatting) resolvesdefaultattribute on read and never wrote itTest plan
--checkclean; clippy-D warningscleanVisual verification (public FancyFoot fixture, page 1)
Paragraph gaps now track GT instead of collapsing upward.
After-image re-audit
Inter-paragraph gaps are still a few percent tighter than Word's — that residue is single-spacing line-height parity (the #251 docGrid work covers Korean-locale grids; Latin documents without a grid still use Typst's leading) and stays under the #214/#213 umbrella line-height thread rather than this cascade issue.
Related: #288
🤖 Generated with Claude Code