Skip to content
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

quarto render --to html makes some html tags visible in the validation report #518

Closed
2 tasks done
cregouby opened this issue Feb 27, 2024 · 3 comments · Fixed by #520
Closed
2 tasks done

quarto render --to html makes some html tags visible in the validation report #518

cregouby opened this issue Feb 27, 2024 · 3 comments · Fixed by #520

Comments

@cregouby
Copy link

cregouby commented Feb 27, 2024

Prework

Description

From a basic agent , the pointblank report in a quarto html document includes unexpected html tags "<div arial label=" and "<span style=" within the cells :
image

This appends equally from the Rstudio IDE "Render" button and from the cli "> quarto render reprex.qmd --to html"

The rendering of the same content in a Rmd document do not have the issue.

Reproducible example

---
title: "Untitled"
format: html
---

```{r}
library(pointblank)
library(tibble)
create_agent(
  tibble(iris),
  label = "Iris Dataset") |> 
  col_exists(columns = c("Sepal.Length", "Sepal.Width", "Species")) |> 
  interrogate()

Created on 2024-02-28 with reprex v2.1.0

Expected result

The expected result can be obtained from knitr on the Rmd file equivalent
image

Session info

Created on 2024-02-28 with reprex v2.1.0

Session info
$ quarto --version
1.5.16
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.3.2 (2023-10-31)
#>  os       Ubuntu 22.04.4 LTS
#>  system   x86_64, linux-gnu
#>  ui       X11
#>  language fr_FR
#>  collate  fr_FR.UTF-8
#>  ctype    fr_FR.UTF-8
#>  tz       Europe/Paris
#>  date     2024-02-28
#>  pandoc   3.1.1 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version     date (UTC) lib source
#>  blastula      0.3.5       2024-02-24 [3] RSPM (R 4.3.0)
#>  cli           3.6.2       2023-12-11 [1] CRAN (R 4.3.2)
#>  commonmark    1.9.0       2023-03-17 [1] CRAN (R 4.3.0)
#>  digest        0.6.33      2023-07-07 [1] CRAN (R 4.3.1)
#>  dplyr         1.1.4       2023-11-17 [1] CRAN (R 4.3.2)
#>  evaluate      0.23        2023-11-01 [1] CRAN (R 4.3.2)
#>  fansi         1.0.6       2023-12-08 [1] CRAN (R 4.3.2)
#>  fastmap       1.1.1       2023-02-24 [1] CRAN (R 4.3.0)
#>  fs            1.6.3       2023-07-20 [1] CRAN (R 4.3.1)
#>  generics      0.1.3       2022-07-05 [1] CRAN (R 4.3.0)
#>  glue          1.6.2       2022-02-24 [1] CRAN (R 4.3.0)
#>  gt            0.10.1      2024-01-17 [3] RSPM (R 4.3.0)
#>  htmltools     0.5.7       2023-11-03 [1] CRAN (R 4.3.2)
#>  knitr         1.45        2023-10-30 [1] CRAN (R 4.3.2)
#>  lifecycle     1.0.4       2023-11-07 [1] CRAN (R 4.3.2)
#>  magrittr      2.0.3       2022-03-30 [1] CRAN (R 4.3.0)
#>  markdown      1.12        2023-12-06 [1] CRAN (R 4.3.2)
#>  pillar        1.9.0       2023-03-22 [1] CRAN (R 4.3.0)
#>  pkgconfig     2.0.3       2019-09-22 [1] CRAN (R 4.3.0)
#>  pointblank  * 0.11.4.9000 2024-02-27 [1] Github (rstudio/pointblank@28ca29e)
#>  purrr         1.0.2       2023-08-10 [1] CRAN (R 4.3.1)
#>  R.cache       0.16.0      2022-07-21 [1] CRAN (R 4.3.1)
#>  R.methodsS3   1.8.2       2022-06-13 [1] CRAN (R 4.3.1)
#>  R.oo          1.25.0      2022-06-12 [1] CRAN (R 4.3.1)
#>  R.utils       2.12.3      2023-11-18 [1] CRAN (R 4.3.2)
#>  R6            2.5.1       2021-08-19 [1] CRAN (R 4.3.0)
#>  reprex        2.1.0       2024-01-11 [3] RSPM (R 4.3.0)
#>  rlang         1.1.2       2023-11-04 [1] CRAN (R 4.3.2)
#>  rmarkdown     2.25        2023-09-18 [1] CRAN (R 4.3.1)
#>  rstudioapi    0.15.0      2023-07-07 [1] CRAN (R 4.3.1)
#>  sass          0.4.8       2023-12-06 [1] CRAN (R 4.3.2)
#>  sessioninfo   1.2.2       2021-12-06 [1] CRAN (R 4.3.0)
#>  styler        1.10.2      2023-08-29 [1] CRAN (R 4.3.1)
#>  tibble      * 3.2.1       2023-03-20 [1] CRAN (R 4.3.0)
#>  tidyselect    1.2.0       2022-10-10 [1] CRAN (R 4.3.0)
#>  utf8          1.2.4       2023-10-22 [1] CRAN (R 4.3.2)
#>  vctrs         0.6.5       2023-12-01 [1] CRAN (R 4.3.2)
#>  withr         2.5.2       2023-10-30 [1] CRAN (R 4.3.2)
#>  xfun          0.41        2023-11-01 [1] CRAN (R 4.3.2)
#>  xml2          1.3.6       2023-12-04 [1] CRAN (R 4.3.2)
#>  yaml          2.3.8       2023-12-11 [1] CRAN (R 4.3.2)
#> 
#>  [1] /home/creg/R/x86_64-pc-linux-gnu-library/4.3
#>  [2] /usr/local/lib/R/site-library
#>  [3] /usr/lib/R/site-library
#>  [4] /usr/lib/R/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────
@yjunechoe
Copy link
Collaborator

yjunechoe commented Feb 28, 2024

This looks like the same issue as rstudio/gt#1488 (and other issues linked within)

Applying a workaround from quarto-dev/quarto-cli#7493, the reprex renders fine on quarto:

library(pointblank)
create_agent(iris) |> 
  col_exists(Sepal.Length) |>
  interrogate() |>
  get_agent_report() |>
  gt::fmt(fns = identity) # `gt::fmt_passthrough(escape = FALSE)` also works here

image

@rich-iannone Should we apply some sort of a workaround like the above before rendering agent/informant reports, to suppress generation of the data-qmd attribute? Or would you prefer to just fix it upstream in {gt}?


On a separate but related note, it looks like <code> inside the report is inheriting the purple color from quarto's theme. I think we should hard code color: black; in the agent's css - here and possibly elsewhere?

#pb_agent code {
font-family: 'IBM Plex Mono', monospace, courier;
background-color: transparent;
padding: 0;
}

@rich-iannone
Copy link
Member

rich-iannone commented Feb 28, 2024

@yjunechoe I was just exploring this this morning! A bit more work is required upstream in gt to fix rstudio/gt#1488. However, I think we should sidestep that for now and use gt::fmt(fns = identity) wherever needed. Also agree with the replacement of purple code text with black.

Would you be able to handle this? I swear this'll be the last thing before the release :/

@yjunechoe
Copy link
Collaborator

No worries! I'd like to see this fixed for this release as well. I'll make a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment