Fix #464
diff --git a/R/collapse_rows.R b/R/collapse_rows.R
index b837194..5491529 100644
--- a/R/collapse_rows.R
+++ b/R/collapse_rows.R
@@ -238,7 +238,7 @@
       )
       new_contents[i] <- paste0(new_contents[i], "\\\\\\\\\n", row_midrule)
     }
-    out <- sub(contents[i + 1], new_contents[i], out)
+    out <- sub(contents[i + 1], new_contents[i], out, perl=TRUE)
   }
   out <- gsub("\\\\addlinespace\n", "", out)
 
diff --git a/docs/awesome_table_in_pdf.pdf b/docs/awesome_table_in_pdf.pdf
index 1282956..846ec7a 100644
--- a/docs/awesome_table_in_pdf.pdf
+++ b/docs/awesome_table_in_pdf.pdf
Binary files differ
diff --git a/inst/NEWS.md b/inst/NEWS.md
index a24ba30..bc7140e 100644
--- a/inst/NEWS.md
+++ b/inst/NEWS.md
@@ -17,6 +17,11 @@
 
 * Added mathjax to preview (#473)
 
+* Fixed a bug with `repeat_header` when the header row is customized (#480)
+
+* Fixed a bug with `collapse_rows` when text is too long. (#464)
+
+
 
 kableExtra 1.1.0
 --------------------------------------------------------------------------------