fix a bug causing issues in tables' cran check
diff --git a/R/row_spec.R b/R/row_spec.R
index 3d08857..ea96971 100644
--- a/R/row_spec.R
+++ b/R/row_spec.R
@@ -203,14 +203,14 @@
hline_after, extra_latex_after)
temp_sub <- ifelse(i == 1 & (table_info$tabular == "longtable" |
!is.null(table_info$repeat_header_latex)),
- stringr::str_replace_all, stringr::str_replace)
+ gsub, sub)
if (length(new_row) == 1) {
- out <- temp_sub(out, paste0(target_row, "\\\\\\\\"),
- paste0(new_row, "\\\\\\\\"))
+ out <- temp_sub(paste0(target_row, "\\\\\\\\"),
+ paste0(new_row, "\\\\\\\\"), out, perl = T)
table_info$contents[i] <- new_row
} else {
- out <- temp_sub(out, paste0(target_row, "\\\\\\\\"),
- paste(new_row, collapse = ""))
+ out <- temp_sub(paste0(target_row, "\\\\\\\\"),
+ paste(new_row, collapse = ""), out, perl = T)
table_info$contents[i] <- new_row[1]
}
}