Repository navigation
fix(pptx): move hidden slides to the invisible content layer - #4647
Conversation
Signed-off-by: Ankit Kumar <ankitkumar19473@gmail.com>
|
✅ DCO Check Passed Thanks @ankit2235, all your commits are properly signed off. 🎉 |
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/
|
Signed-off-by: Ankit Kumar <ankitkumar19473@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Hi @ankit2235, can you resolve the merge conflict? |
Signed-off-by: Ankit Kumar <ankitkumar19473@gmail.com> # Conflicts: # tests/test_backend_pptx.py
AI triage (advisory)Checked commit The PR adds Topic labels added: CI safety: no concern found. A maintainer must still approve CI. 2 related pull request(s) in the same code
The |
|
Hi @DanielNg0729 |
* 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>
A slide hidden in PowerPoint (
<p:sld show="0">, Hide Slide; Skip slide in Google Slides) was converted like a normal slide, so its text went into the body and the default exports, although it is not presented.The content of a hidden slide now goes to
ContentLayer.INVISIBLE, the same as hidden Excel and ODS sheets (#1876): it stays available to callers who request that layer, and the default exports leave it out. Speaker notes and comments keepContentLayer.NOTES. Visible slides are unchanged.With the Google Slides file attached to #4646, the Markdown export now contains only slide 1; the hidden slide 2 is in the invisible layer.
The new test builds a deck with one visible and one hidden slide. It checks the default Markdown export, the invisible layer and the notes layer. It fails on
mainand passes with this change; the other PowerPoint tests pass unchanged.If you prefer a different behavior for hidden slides (for example an option), I'm happy to change it.
Issue resolved by this Pull Request:
Resolves #4646
Checklist: