From 569a5bfbde36ec7dab6c24691147d84412c884af Mon Sep 17 00:00:00 2001
From: wkmor1 <1680870+wkmor1@users.noreply.github.com>
Date: Sat, 24 Aug 2024 10:30:04 +0300
Subject: [PATCH 1/6] Remove slash from void elements
---
R/tags.R | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/R/tags.R b/R/tags.R
index 8848b393..5fd0cd0f 100644
--- a/R/tags.R
+++ b/R/tags.R
@@ -914,12 +914,12 @@ tagWrite <- function(tag, textWriter, indent=0, eol = "\n") {
}
}
else {
- # only self-close void elements
+ # close void elements
# (see: http://dev.w3.org/html5/spec/single-page.html#void-elements)
if (tag$name %in% c("area", "base", "br", "col", "command", "embed", "hr",
"img", "input", "keygen", "link", "meta", "param",
"source", "track", "wbr")) {
- textWriter$write("/>")
+ textWriter$write(">")
}
else {
textWriter$write(concat8(">", tag$name, ">"))
From dae951cae71ccd0d5408007946dbac61302313dc Mon Sep 17 00:00:00 2001
From: wkmor1 <1680870+wkmor1@users.noreply.github.com>
Date: Sat, 24 Aug 2024 10:31:52 +0300
Subject: [PATCH 2/6] Remove slash from void element
---
tests/testthat/test-tags.r | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/testthat/test-tags.r b/tests/testthat/test-tags.r
index 195c1f86..8e683788 100644
--- a/tests/testthat/test-tags.r
+++ b/tests/testthat/test-tags.r
@@ -19,7 +19,7 @@ test_that("Basic tag writing works", {
"one")
expect_equal(
as.character(tagList(tags$br(), "one")),
- "
\none")
+ "
\none")
})
test_that("Hanging commas don't break things", {
From abd720a7632bc9587af4360c39784074c6abb97c Mon Sep 17 00:00:00 2001
From: wkmor1 <1680870+wkmor1@users.noreply.github.com>
Date: Sat, 24 Aug 2024 10:42:50 +0300
Subject: [PATCH 3/6] Remove trailing slash from meta tag
---
R/html_print.R | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/R/html_print.R b/R/html_print.R
index c6943953..73d43fd2 100644
--- a/R/html_print.R
+++ b/R/html_print.R
@@ -112,7 +112,7 @@ save_html.default <- function(html, file, background = "white", libdir = "lib",
html <- c("",
sprintf('', lang),
"