Closed petrbouchal closed 1 year ago
@cscheid for this one I wonder if we are not handling correctly the parsing of this complex HTML table in our parse_html_tables()
.
I don't know well the internal for those recent changes but are we parsing all HTML table in raw block even when outputing a HTML format ?
I was looking into that because I was curious of the new processing. And when comparing intermediate markdown and HTML output, the table
part of the gt_table
has completely dissapear from HTML output. It seem we are not parsing this complex raw HTML table as a Table in AST.
We have also tableRenderRawHtml()
in a later place which has some filters regarding HTML like format
https://github.com/quarto-dev/quarto-cli/blob/f00d8fd7fee31e2bf5d4e30ec81d87bb2e43479d/src/resources/filters/quarto-pre/table-rawhtml.lua#L47-L56
but this is too late - the raw HTML table was already processed in the other pre step.
Anyway, just some hints. @rich-iannone will obviously know more about the complexity with the HTML table from pointblank.
I am just curious to understand this processing better.
@petrbouchal Sorry for the very late reply on this. With newer versions of Quarto, gt tables all render properly. There are some minor issues styles in the pointblank reporting tables in particular (screenshot attached of a recent render) but this is more to do with gt itself and some CSS-integration issues that pointblank could handle (mostly to do with the <code>
text).
Here is my recent test with a bigger output table (to test more of what might go wrong) in the very latest (main
) of Quarto:
---
format: html
---
```{r setup}
library(pointblank)
agent <-
create_agent(
tbl = ~ small_table,
actions = action_levels(stop_at = 0.1)
) %>%
col_vals_gt(
vars(date_time), vars(date),
na_pass = TRUE
) %>%
col_vals_gt(
vars(b), vars(g), na_pass = TRUE,
label = "b > g"
) %>%
col_is_character(
vars(b, f),
label = "Verifying character-type columns"
) %>%
rows_distinct(
vars(d, e, f),
label = "Distinct rows across 'd', 'e', and 'f'"
) %>%
col_is_integer(
vars(a),
label = "`a` must be an integer",
active = FALSE
) %>%
interrogate()
agent
<img width="1017" alt="pointblank-table-quarto" src="https://github.com/quarto-dev/quarto-cli/assets/5612024/64c4784b-b1da-412b-9ebf-fb28f9eee871">
Going to close this as I think this is resolved (i.e., you can render the output, though refinements need to be made by the developer of the {pointblank} and {gt} packages).
Bug description
I am trying to include the output of {pointblank} validation, which is a complex HTML table based on {gt}. A reprex qmd file looks like this:
then render the markdown doc via
pandoc --to html test.md -o test.html
, the HTML table in the output is correct:Simple {gt} tables render correctly in the normal quarto rendering workflow.
This leads me to guess that the problem might be in the default filters that quarto applies during the pandoc rendering step.
Versions
Quarto version: 1.3.203
RStudio version 2023.03.0-daily+323 (2023.03.0-daily+323)
Session Info
Checklist