Skip to content
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

Removing slide doesn't remove slides from [Content_Types].xml #131

Open
jamieshield opened this issue Feb 14, 2024 · 0 comments
Open

Removing slide doesn't remove slides from [Content_Types].xml #131

jamieshield opened this issue Feb 14, 2024 · 0 comments

Comments

@jamieshield
Copy link

Removing slide doesn't remove the slide's relationships from [Content_Types].xml.
That is, calling removeSlide to remove slide 2 does delete the following from [Content_Types].xml.

From my naive diagnosis, calling removeSlide calls the factory removeSlide.
removeSlide(slide) {
this.powerPointFactory.removeSlide(slide.name);

The factory removeSlide calls removeContentType(partName)
factories/index.js:
removeSlide(slideName) { ...
this.contentTypeFactory.removeContentType(/ppt/slides/${slideName}.xml);

However, removeContentType is defined with two parameters partName and contentType.
So the contentType never matches and the slides' relationship in ContentType.xml is not removed.

Adding a default parameter was a (hack) solution for me.
node-pptx/lib/factories/content-types.js:
removeContentType(partName, contentType = "application/vnd.openxmlformats-officedocument.presentationml.slide+xml")

Time poor newbie reporting an issue - just trying to help. Apologies in advance for any inappropriateness in this issue report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant