Skip to content

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

Description

@jamieshield

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions