-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dashboard processes any hidden Div as cell computation output causing problem with our parsed HTML table processing #9696
Comments
In the produced HTML we have a Somehow, a card is not created in this case, and cell results indersted into it. This seems related to the I don't know why it triggers on dashboard only, but I noticed that gt will always use Fixing the interemediate .md like this work @rich-iannone but then there is a double processing because of the other div <div data-qmd="**here**"><div class='gt_from_md'><p><strong>here</strong></p>
</div></div> Let's discuss more in rstudio/gt#1605 maybe; I'll keep that open to understand why the (it works when using Markdown syntax https://quarto.org/docs/dashboards/layout.html#cards) |
So this happens because we do a specific iteration on quarto-cli/src/resources/filters/quarto-post/dashboard.lua Lines 262 to 284 in 283ed3b
It happens that our HTML parsing for table does introduced some scaffolding element with quarto-cli/src/resources/filters/normalize/extractquartodom.lua Lines 15 to 19 in 283ed3b
If So this is a conflict between feature. Not sure of the scafold element needs to be Now we know what is happening we need to see what to do at which levels |
Thanks so much for looking into this and for the explanations! Honestly, it took me a while to figure out what actually caused this issue |
@rich-iannone this is the issue we discussed about. Possibly this is to be done in Quarto and not just fixing in gt |
@cderv Hi! thanks for targeting this. I just observed a new regression... An example that worked with Quarto 1.4.554, but that no longer works with Quarto 1.4.555... To get around this, I ended up using I am guessing this is related to including #9602 in the latest patch: Fix regression with parsed HTML tables not being correctly included in various format like pptx and typst. The workaround I used to make it work with gt 0.10.0 + Quarto 1.4.554 was to use Works in 1.4.554, not in 1.4.555 (to be confirmed) with gt 0.10.1 ---
title: "dash-test"
format: dashboard
editor: visual
editor_options:
chunk_output_type: console
---
## Heading
```{r}
#| title: a title0
library(gt)
exibble |>
gt::gt() |>
cols_label(
num = html("<strong>This text is important!</strong>")
)
```
I may be mistaken as I still haven't installed 1.4.555 locally, but that's what I am seeing on CI. |
@cscheid Thanks for checking. Indeed doesn't seem to be an issue in the 1.5 latest prerelease. (However, my full dashboard still fails to render in 1.5 due to another issue #9796 , explanations below) If you can't repro on 1.4.555, I will try to find a better example when I have the chance to install that version. My real-life example is more complex. I will try coming up with something better when I have time. Note that this isn't an issue in 1.5, nor 1.4.554, only 1.4.555 as far as I can tell. I just tested building my dashboard with latest prerelease. The table doesn't disappear, but elsewhere in my dashboard I have some blocks with |
@cscheid I am seeing now, this was not mentioned but the original issue is with dev version of gt. In current CRAN release version, With current dev version, So to reproduce you need to install dev gt And what I described above still applies
I put the
needs-discussion
@olivroy thanks for sharing other feedback. It mixes a little topic, as it could be different. I can't reproduce the error you see with ---
title: "dash-test"
format: dashboard
keep-md: true
---
## Heading
```{r}
#| title: a title0
library(gt)
exibble |>
gt::gt() |>
cols_label(
num = html("<strong>This text is important!</strong>")
)
``` This gives me correct result with gt dev version, using quarto latest 1.5 - it fails in 1.4.555 And I think you identified #9602 correctly, the patch 87a2fe8 is using the scaffolding which has the hidden class, and trigger this exact bug 1.5 don't have the issue because we use the other scaffold function that do not add the hidden class
So this is the exact same issue and I did not pay attention enough to this... Sorry for the trouble; I'll rename the issue to make the real problem clear to us; |
md()
don't show in dashboard
@cderv Thanks again for your response! Thanks @cscheid for fixing #9796 and pushing v1.5.41. My dashboard renders again as expected with the pre-release version of Quarto and CRAN gt 0.10.1.
@cderv Let me know if you plan to make other patches for Quarto 1.4 at some point (I will try following progress if possible), If so, I will open a new issue with a reprex. Otherwise I will just leave it as is for now, as I trust that you correctly identified the problem. |
I see. Thanks for the clarification. I can repro it now.
Agreed. Reviewing the code now, I don't understand why we have
This is pretty intentional: quarto-cli/src/resources/filters/quarto-post/dashboard.lua Lines 283 to 284 in 3c0d9f2
So I think the correct solution is really to just replace make_scaffold with scaffold_element. |
Thanks.
I saw that one. I just don't know why we need to do the special processing that follows for hidden divs nested in cell div. I suspect this targeted some specific content and that hidden div inside tables were not part of if. I guess now this won't happen again soon. But it could still happen if some html widget or else produce some raw html content with somewhere in the children a hidden div. That is why I questioned this intentional identification. Anyhow if it happens I'll remember this one. |
I agree, but the |
Bug description
A gt table with
cols_label(md())
disappears silently in quarto dashboard. It shows as expected in other quarto document types. So I am wondering if the bug is on gt's side, or could it be fixed in Quarto.fmt_markdown
don't render in quarto dashboard rstudio/gt#1605Steps to reproduce
Expected behavior
Table should be present, or an error should be signaled that the table is malformed or something
Actual behavior
The table disappears silently from output.
Your environment
IDE: RStudio 2024.04 on Windows (also reproducible on quartopub.
Quarto check output
The text was updated successfully, but these errors were encountered: