From 003e395ce5906cca26f09146b6179f5363ba01f5 Mon Sep 17 00:00:00 2001 From: Kaspar Meili Date: Wed, 14 Aug 2024 12:21:20 +0200 Subject: [PATCH] fix: remove_fields in docx_summary() should also remove w:fldData nodes --- R/fortify_docx.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/fortify_docx.R b/R/fortify_docx.R index 330c11aa..11d8bf72 100644 --- a/R/fortify_docx.R +++ b/R/fortify_docx.R @@ -236,6 +236,9 @@ docx_summary <- function(x, preserve = FALSE, remove_fields = FALSE, detailed = if (remove_fields) { instrText_nodes <- xml_find_all(x$doc_obj$get(), "//w:instrText") xml_remove(instrText_nodes) + + fldData_nodes <- xml_find_all(x$doc_obj$get(), "//w:fldData") + xml_remove(fldData_nodes) } all_nodes <- xml_find_all(x$doc_obj$get(), "/w:document/w:body/*[self::w:p or self::w:tbl]")