Repository navigation
fix(pptx): move hidden shapes to the invisible content layer - #4733
Merged
DanielNg0729 merged 2 commits intoOct 10, 2026
Merged
DanielNg0729 merged 2 commits into
DanielNg0729 merged 2 commits into
Conversation
A shape hidden in PowerPoint's Selection Pane (p:cNvPr/@hidden) on a shown slide was emitted as body content. Treat it like a hidden slide: its items, and those of every shape inside a hidden group, go to ContentLayer.INVISIBLE. Signed-off-by: Praveen Mittal <pkmittal28@gmail.com>
Contributor
|
✅ DCO Check Passed Thanks @mittalpk, all your commits are properly signed off. 🎉 |
Contributor
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
tests/test_backend_pptx.py went past the 1500-line limit. Signed-off-by: Praveen Mittal <pkmittal28@gmail.com>
DanielNg0729
approved these changes
Oct 10, 2026
This was referenced Oct 11, 2026
1 of 3 tasks
This was referenced Oct 21, 2026
DanielNg0729
added a commit
that referenced
this pull request
Oct 23, 2026
* fix(docx): leave hidden text out of the default export Text with Word's Hidden font property (w:vanish) was emitted as body content, although Word does not show or print it. A fully hidden paragraph now goes to ContentLayer.INVISIBLE, the same treatment a hidden PPTX slide (#4647) or shape (#4733) gets. A hidden run inside a shown paragraph or a table cell cannot have its own layer, so it is dropped from the text. The hidden state is resolved from the run, then its character style chain, then the paragraph style chain. Documents with no w:vanish skip the checks, so conversion speed is unchanged. Signed-off-by: Michael Ghaly <m.ghaly.bo@gmail.com> * fix(docx): hide hidden headings, list items and note text too Address the review of the first commit: - Headings and list items take their own add calls, which did not pass the content layer. They now go to ContentLayer.INVISIBLE when hidden. List groups stay on the surrounding layer, so a hidden first item no longer hides the shown items after it or makes the list loose. - The equation parser read the w:t of hidden runs, so its rebuilt text did not match and the equation was lost. It now skips hidden runs. A table cell with an equation also kept its hidden text; it does not now. - A paragraph with an equation is never fully hidden, and an equation with only hidden text beside it is a standalone formula again. - python-docx loads footnotes and endnotes as plain parts, so w:vanish only there was not found. A hidden paragraph in a note is now left out. - Documents without w:vanish skip the style chain lookups for every run and table cell run. Signed-off-by: Michael Ghaly <m.ghaly.bo@gmail.com> * chore: drop duplicate import left by the main merge Signed-off-by: Daniel Nguyen <danielnguyenh07@gmail.com> --------- Signed-off-by: Michael Ghaly <m.ghaly.bo@gmail.com> Signed-off-by: Nguyen Hoang Duong <danielnguyenh07@gmail.com> Signed-off-by: Daniel Nguyen <danielnguyenh07@gmail.com> Co-authored-by: Nguyen Hoang Duong <danielnguyenh07@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.
A shape hidden in PowerPoint's Selection Pane (
hiddenonp:cNvPr) was still exported as body text when its slide was shown. This moves the content of a hidden shape toContentLayer.INVISIBLE, the same treatment #4647 gave hidden slides. It applies to text boxes, pictures, tables, charts and connectors, and a hidden group hides everything inside it.The shape still runs through the normal handlers, so nothing is dropped; the items they add are moved to the invisible layer afterwards.
Issue resolved by this Pull Request:
Resolves #4732
Checklist: