Skip to content

Commit 4e3add1

Browse files
committed
fix warning in html
1 parent cff928d commit 4e3add1

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

R/save_as_html.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ create_yaml_header_html <- function(object_path, pkg_to_attach, css = NULL) {
1818

1919
c(
2020
"---",
21+
"title: \" \"",
2122
"output:",
2223
" html_document:",
2324
" self_contained: true",

tests/testthat/test-save_as_html.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ test_that("save_html() works with gt table", {
1919
)
2020
expect_true(file.exists(file_path))
2121

22-
expect_match(regexp = "html_document", res[3], fixed = TRUE)
23-
expect_match(regexp = "self_contained: true", res[4], fixed = TRUE)
24-
expect_match(regexp = "library(gt)", res[9], fixed = TRUE)
25-
expect_match(regexp = "x[[1]]", res[16], fixed = TRUE)
22+
expect_match(regexp = "html_document", res[4], fixed = TRUE)
23+
expect_match(regexp = "self_contained: true", res[5], fixed = TRUE)
24+
expect_match(regexp = "library(gt)", res[10], fixed = TRUE)
25+
expect_match(regexp = "x[[1]]", res[17], fixed = TRUE)
2626
})
2727

2828
test_that("save_html() works with a list of gt tables", {
@@ -35,8 +35,8 @@ test_that("save_html() works with a list of gt tables", {
3535
)
3636
expect_true(file.exists(file_path))
3737

38-
expect_match(regexp = "x[[1]]", res[16], fixed = TRUE)
39-
expect_match(regexp = "x[[2]]", res[22], fixed = TRUE)
38+
expect_match(regexp = "x[[1]]", res[17], fixed = TRUE)
39+
expect_match(regexp = "x[[2]]", res[23], fixed = TRUE)
4040
})
4141

4242
test_that("save_html() works with gtsummary table", {

0 commit comments

Comments
 (0)