-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle a Shape having formula - AlternateContent #706
base: master
Are you sure you want to change the base?
Conversation
Symptom: Once a formula added into any type of shape, then Slide.shapes will not handle the Shape Reason: The shape is represented inside of AlternateContent element. Solution: Select first item of AlternateContent as a content.
Any chance someone could review this MR? I'm running into this bug myself, and would love to have a fix. The workaround, to not have any equations in my slide deck, isn't a great option. I don't know the code-base well enough to review this MR myself. In my case this causes tables containing equations to not be visible to my code, failing silently. |
This PR bakes in the assumption that the user wants a specific "choice" (in the markup compatibility parlance). Another approach would be to explicitly define this as a new shape node. The XML can be parsed like:
Then maybe produce a
For the example with equations, the most likely scenario is you traverse |
@scanny Do you have any interest in supporting these "AlternateContent" elements? They are essentially conditional branches of XML that allow fallbacks for features that may not be backwards compatible with older versions of PowerPoint. PowerPoint may place these branches near the root of the shape tree, instead of tightly bounding a feature. So if you have math formulas inside a table, then that table won't be enumerated as a shape because it will be nested in one of these branches. For example, if you have a table containing "math stuff", needing >=2010, then the XML tree may look like:
If you're interested, guidance on implementation would be appreciated. There's an implementation in this PR, and I've also proposed an alternative. Thanks. |
@seyong-um |
Symptom: Once a formula added into any type of shape, then Slide.shapes will not handle the Shape
Reason: The shape is represented inside of AlternateContent element.
Solution: Select first item of AlternateContent as a content.