Skip to content

Commit

Permalink
fix: remove_fields in docx_summary() should also remove w:fldData nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
kdevkdev authored Aug 14, 2024
1 parent 6503562 commit 003e395
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/fortify_docx.R
Original file line number Diff line number Diff line change
Expand Up @@ -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]")
Expand Down

0 comments on commit 003e395

Please sign in to comment.