collapse_html_chr <- function(x) { x <- paste(x, collapse = "\n") gsub("\\s*\n\\s*", "", x) } expect_html_chr <- function(x, y) { expect_equal(collapse_html_chr(x), collapse_html_chr(y)) }