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

htmlwidgets in quarto cause rendering error #2286

Closed
3 tasks done
Bisaloo opened this issue Sep 7, 2023 · 3 comments
Closed
3 tasks done

htmlwidgets in quarto cause rendering error #2286

Bisaloo opened this issue Sep 7, 2023 · 3 comments

Comments

@Bisaloo
Copy link

Bisaloo commented Sep 7, 2023

Reproducible example

This is a test file test.qmd:

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

```{r}
library(visNetwork)
nodes <- data.frame(id = 1:6, title = paste("node", 1:6), 
                    shape = c("dot", "square"),
                    size = 10:15, color = c("blue", "red"))
edges <- data.frame(from = 1:5, to = c(5, 4, 6, 3, 3))
visNetwork(nodes, edges) %>%
  visOptions(highlightNearest = TRUE, nodesIdSelection = TRUE)
```

Error:

processing file: reprex.qmd
1/3                  
2/3 [unnamed-chunk-1]

Quitting from lines 7-14 [unnamed-chunk-1] (reprex.qmd)
Error in `add_html_caption()`:
! unused argument (xfun::grep_sub("^[^<]*<[^>]+aria-labelledby[ ]*=[ ]*\"([^\"]+)\".*$", "\\1", x))
Backtrace:
  1. global .main()
  2. execute(...)
  3. rmarkdown::render(...)
  4. knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
  5. knitr:::process_file(text, output)
     ...
 14. sew(res, options)
 15. knitr:::sew.list(x, options, ...)
 16. base::lapply(x, sew, options, ...)
 17. FUN(X[[i]], ...)
 18. knitr:::sew.knit_asis(x, options, ...)
Execution halted

It seems that the error comes from the add_html_caption() call here:

knitr/R/output.R

Lines 509 to 512 in 43dd3ae

return(add_html_caption(
options, wrap_asis(x, options),
xfun::grep_sub('^[^<]*<[^>]+aria-labelledby[ ]*=[ ]*"([^"]+)".*$', '\\1', x)
))

but I can't figure out why this fails. 3 arguments are provided and add_html_caption() has 3 arguments.

Session info
R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS, RStudio 2023.9.0.290


Locale:
  LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
  LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8    LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

time zone: Europe/Paris
tzcode source: system (glibc)

Package version:
  base64enc_0.1.3   bslib_0.5.0       cachem_1.0.8      cli_3.6.1         compiler_4.3.1    cpp11_0.4.4      
  ctv_0.9-5         curl_5.0.1        digest_0.6.33     dplyr_1.1.2       ellipsis_0.3.2    evaluate_0.21    
  fansi_1.0.4       fastmap_1.1.1     fontawesome_0.5.1 fs_1.6.2          generics_0.1.3    glue_1.6.2       
  graphics_4.3.1    grDevices_4.3.1   highr_0.10        htmltools_0.5.5   jquerylib_0.1.4   jsonlite_1.8.7   
  knitr_1.43        lifecycle_1.0.3   magrittr_2.0.3    memoise_2.0.1     methods_4.3.1     mime_0.12        
  parsedate_1.3.1   pillar_1.9.0      pkgconfig_2.0.3   pkgsearch_3.1.2   prettyunits_1.1.1 purrr_1.0.1.9000 
  R6_2.5.1          rappdirs_0.3.3    rlang_1.1.1       rmarkdown_2.23    rstudioapi_0.15.0 sass_0.4.7       
  sessioninfo_1.2.2 stats_4.3.1       stringi_1.7.12    stringr_1.5.0     tibble_3.2.1      tidyr_1.3.0      
  tidyselect_1.2.0  tinytex_0.45      tools_4.3.1       utf8_1.2.3        utils_4.3.1       vctrs_0.6.3      
  withr_2.5.0       xfun_0.39         yaml_2.3.7       
---

By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.org/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('knitr'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/knitr').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@yihui
Copy link
Owner

yihui commented Sep 7, 2023

This has already been fixed in the dev version of knitr. Please do read and follow the issue guide at the bottom of your issue. In particular:

  • also tried the development version: remotes::install_github('yihui/knitr').

Thanks!

@yihui
Copy link
Owner

yihui commented Sep 7, 2023

Duplicate of #2261

@yihui yihui marked this as a duplicate of #2261 Sep 7, 2023
@yihui yihui closed this as completed Oct 27, 2023
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants