Skip to content

Commit

Permalink
Fix #248: disable quarto processing on HTML table
Browse files Browse the repository at this point in the history
  • Loading branch information
hughjonesd committed Oct 10, 2023
1 parent 6fed6f7 commit 1a8f296
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 152 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
`.` is now vector rather than matrix when dplyr version 1.1.0 is detected.
Thanks @DavisVaughan.
* Add package checks in `quick_*` functions. Thanks @reuning.
* Bugfix: disable quarto styling on HTML tables.

# huxtable 5.5.1

Expand Down
6 changes: 4 additions & 2 deletions R/html.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ to_html.huxtable <- function(ht, ...) {
lab <- make_label(ht)
id_string <- if (is.na(lab)) "" else sprintf(" id=\"%s\"", lab)

table_start <- sprintf(
'<table class="huxtable" style="border-collapse: collapse; border: 0px; margin-bottom: 2em; margin-top: 2em; %s; %s %s %s"%s>\n',
table_start <- sprintf(paste0(
'<table class="huxtable" quarto-disable-processing="true" ',
'style="border-collapse: collapse; border: 0px; ',
'margin-bottom: 2em; margin-top: 2em; %s; %s %s %s"%s>\n'),
width_string, margin_string, height_string, float_string, id_string)

if (! is.na(cap <- make_caption(ht, lab, "html"))) {
Expand Down
Loading

0 comments on commit 1a8f296

Please sign in to comment.