Skip to content

Commit

Permalink
fix yihui/xaringan#307: don't add a div around the sql table output
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Mar 18, 2022
1 parent d919733 commit fb54231
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: knitr
Type: Package
Title: A General-Purpose Package for Dynamic Report Generation in R
Version: 1.37.6
Version: 1.37.7
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")),
person("Abhraneel", "Sarma", role = "ctb"),
Expand Down
5 changes: 3 additions & 2 deletions R/engine.R
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,8 @@ eng_sql = function(options) {
display_data[[1]] = as.character(first_column)

# wrap html output in a div so special styling can be applied
if (is_html_output()) cat('<div class="knitsql-table">\n')
add_div = is_html_output() && is.null(getOption('xaringan.format'))
if (add_div) cat('<div class="knitsql-table">\n')

# determine records caption
caption = options$tab.cap
Expand All @@ -684,7 +685,7 @@ eng_sql = function(options) {
print(kable(display_data, caption = caption))

# terminate div
if (is_html_output()) cat("\n</div>\n")
if (add_div) cat("\n</div>\n")

# otherwise use tibble if it's available
} else if (loadable('tibble')) {
Expand Down

0 comments on commit fb54231

Please sign in to comment.