From 9241aded4f95040f30267b42c765f6baa9341455 Mon Sep 17 00:00:00 2001 From: David Gohel Date: Sun, 22 Oct 2023 13:39:21 +0200 Subject: [PATCH] fix: support for a new invalid document coming from non MS source fix #522 --- DESCRIPTION | 2 +- NEWS.md | 1 + R/core_properties.R | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index fef84d8c..e4e5a04f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: officer Type: Package Title: Manipulation of Microsoft Word and PowerPoint Documents -Version: 0.6.3.004 +Version: 0.6.3.005 Authors@R: c( person("David", "Gohel", role = c("aut", "cre"), email = "david.gohel@ardata.fr"), diff --git a/NEWS.md b/NEWS.md index 601f3820..431b65b4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,7 @@ - new function `run_comment()` to create a run with a comment. - new function `docx_comments()` to read comments in a Word document as a data.frame. +- Add pptx support for invalid pptx files downloaded from https://slides.new. ## Issues diff --git a/R/core_properties.R b/R/core_properties.R index ac7812ab..7972ad30 100644 --- a/R/core_properties.R +++ b/R/core_properties.R @@ -91,6 +91,7 @@ write_core_properties <- function(core_matrix, package_dir){ drop_templatenode_from_app <- function(package_dir){ file <- file.path(package_dir, "docProps", "app.xml") + if (!file.exists(file)) return() doc <- read_xml(file) node_template <- xml_child(doc, "d1:Template") if (!inherits(node_template, "xml_missing")) {