change to a safer regex method for repeat_header
diff --git a/R/kable_styling.R b/R/kable_styling.R
index d7aa1f5..f68b60c 100644
--- a/R/kable_styling.R
+++ b/R/kable_styling.R
@@ -266,7 +266,7 @@
)
} else {
if (repeat_header_method == "append") {
- caption_without_lab <- sub("\\\\label\\{.*?\\}", "", table_info$caption)
+ caption_without_lab <- sub("\\\\label\\{[^\\}]*\\}", "", table_info$caption)
repeat_header_text <- paste(caption_without_lab, repeat_header_text)
}
continue_line <- paste0("\\caption{", repeat_header_text, "}\\\\")