Changes to `blogdown::shortcode_open(..., .type = "html")` and `blogdown::shortcode_close(..., .type = "html")`

I am not exactly sure what happened but the output from blogdown::shortcode_open(..., .type = "html") and blogdown::shortcode_close(..., .type = "html") appear to have changed for me. I've attached a screenshot of the diff for the output from blogdown::shortcode_open(..., .type = "html"). The actual code generating this output has not changed.

I thought at first this was related to updating blogdown, but I've installed older versions of blogdown and I'm still getting the same thing, so perhaps it's related to an update to a blogdown dependency? At any rate, this new output does not render correctly for me.

Any help would be appreciated.

Alright, I think I figured out what's going on here. It looks like it's related to the latest update to rmarkdown, not blogdown. If I re-install v2.5 (remotes::install_github("rstudio/rmarkdown@v2.5"), it all works as I would expect. As an FYI, I also ran into this with @grrrck's countdown package.

v2.5 renders the countdown code like this, which works

while v2.6 renders the countdown code like this, which does not (for me)

I instead end up with that code echo'd into my slides.

Hello !

Sorry to have miss your first post.

This is indeed a change in rmarkdown following a change in htmltools on how raw HTML content is preserved.

Are you using these function in a blogdown project ? Or in another type of project ?

BTW you should try the dev version of blogdown that should handle this correctly. If not, we'll need to fix.

As a workaround you can deactivate this by using dev version of rmarkdown and setting the option options(htmltools.preserve.raw = FALSE)

However, I would like to know when this is happening. With which format ? in which type of project ?

For xaringan, you should try last dev version which should handle this well.

Can you share more on the examples ?

Thank you !

1 Like

I just installed blogdown, rmarkdown, and xaringan from GitHub. It looks like the issue with xaringan slides has been fixed but I'm still getting the same issue with blogdown.

The blogdown code is from a blogdown website. Below is how it's rendering a table, for example

The actual project is here: https://github.com/uo-datasci-specialization/c2-dataviz-2021

The code that is producing the table from the screenshot is here: https://github.com/uo-datasci-specialization/c2-dataviz-2021/blob/main/content/assignments/index.Rmarkdown#L35-L37

My session info is below. Please let me know if I missed anything or if there's other info you need.

> xfun::session_info()
R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7, RStudio 1.4.869

Locale: en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8

Package version:
  askpass_1.1          assertthat_0.2.1     backports_1.2.1      base64enc_0.1.3     
  bayesplot_1.8.0      BH_1.75.0.0          bitops_1.0.6         blob_1.2.1          
  blogdown_1.1.10      bookdown_0.21        boot_1.3.25          brew_1.0.6          
  brio_1.1.1           broom_0.7.3          callr_3.5.1          cellranger_1.1.0    
  checkmate_2.0.0      cli_2.3.0            clipr_0.7.1          colorblindr_0.1.0   
  colorspace_2.0-0     colourpicker_1.1.0   commonmark_1.7       compiler_4.0.2      
  countdown_0.3.5      covr_3.5.1           cowplot_1.1.1        cpp11_0.2.6         
  crayon_1.4.0         credentials_1.3.0    crosstalk_1.1.1      curl_4.3            
  DBI_1.1.1            dbplyr_1.4.4         desc_1.2.0           devtools_2.3.1      
  diffobj_0.3.3        digest_0.6.27        dplyr_1.0.3          DT_0.17             
  dviz.supp_0.1.0      dygraphs_1.1.1.6     ellipsis_0.3.1       evaluate_0.14       
  fansi_0.4.2          farver_2.0.3         fastmap_1.0.1        forcats_0.5.0       
  fs_1.5.0             gapminder_0.3.0      generics_0.1.0       gert_1.0.2          
  ggplot2_3.3.3        ggrepel_0.8.2        ggridges_0.5.3       ggtext_0.1.1        
  gh_1.2.0             gitcreds_0.1.0       glue_1.4.2           graphics_4.0.2      
  grDevices_4.0.2      grid_4.0.2           gridExtra_2.3        gridtext_0.1.4      
  gtable_0.3.0         gtools_3.8.2         haven_2.3.1          here_0.1            
  highr_0.8            hms_0.5.3            htmltools_0.5.1.1    htmlwidgets_1.5.3   
  httpuv_1.5.5         httr_1.4.2           igraph_1.2.6         ini_0.3.1           
  inline_0.3.17        isoband_0.2.3        jpeg_0.1.8.1         jsonlite_1.7.2      
  knitr_1.31           labeling_0.4.2       later_1.1.0.1        lattice_0.20-41     
  lazyeval_0.2.2       lifecycle_0.2.0      lme4_1.1.26          loo_2.4.1           
  lubridate_1.7.9      magick_2.5.2         magrittr_2.0.1       markdown_1.1        
  MASS_7.3.51.6        Matrix_1.2-18        matrixStats_0.57.0   memoise_1.1.0       
  methods_4.0.2        mgcv_1.8-31          mime_0.9             miniUI_0.1.1.1      
  minqa_1.2.4          modelr_0.1.8         munsell_0.5.0        nlme_3.1-148        
  nloptr_1.2.2.2       openssl_1.4.3        packrat_0.5.0        parallel_4.0.2      
  pillar_1.4.7         pkgbuild_1.2.0       pkgconfig_2.0.3      pkgload_1.1.0       
  plyr_1.8.6           png_0.1.7            praise_1.0.0         prettyunits_1.1.1   
  processx_3.4.5       progress_1.2.2       promises_1.1.1       ps_1.5.0            
  purrr_0.3.4          R6_2.5.0             rappdirs_0.3.1       rcmdcheck_1.3.3     
  RColorBrewer_1.1.2   Rcpp_1.0.6           RcppEigen_0.3.3.9.1  RcppParallel_5.0.2  
  RCurl_1.98.1.2       readr_1.4.0          readxl_1.3.1         rematch_1.0.1       
  rematch2_2.1.2       remotes_2.2.0        reprex_0.3.0         reshape2_1.4.4      
  rex_1.2.0            rlang_0.4.10         rmarkdown_2.6.6      roxygen2_7.1.1      
  rprojroot_2.0.2      rsconnect_0.8.16     rstan_2.21.2         rstanarm_2.21.1     
  rstantools_2.1.1     rstudioapi_0.13      rversions_2.0.2      rvest_0.3.6         
  scales_1.1.1         selectr_0.4.2        servr_0.21           sessioninfo_1.1.1   
  shiny_1.5.0          shinyjs_2.0.0        shinystan_2.5.0      shinythemes_1.1.2   
  socviz_1.2           sourcetools_0.1.7    splines_4.0.2        StanHeaders_2.21.0.7
  statmod_1.4.35       stats_4.0.2          stats4_4.0.2         stringi_1.5.3       
  stringr_1.4.0        survival_3.1.12      sys_3.4              testthat_3.0.1      
  threejs_0.3.3        tibble_3.0.6         tidyr_1.1.2          tidyselect_1.1.0    
  tidyverse_1.3.0      tinytex_0.29         tools_4.0.2          usethis_1.9.0.9000  
  utf8_1.1.4           utils_4.0.2          V8_3.4.0             vctrs_0.3.6         
  viridisLite_0.3.0    waldo_0.2.3          whisker_0.4          withr_2.4.1         
  xaringan_0.19.2      xfun_0.20            xml2_1.3.2           xopen_1.0.0         
  xtable_1.8.4         xts_0.12.1           yaml_2.2.1           zip_2.1.1           
  zoo_1.8.8 

Can you share also the Pandoc version ?

rmarkdown::pandoc_version()

I think this is a bug in blogdown and I know why. Thank you for the report!

1 Like

Sure thing! It is 2.9.2.1.

1 Like

Thanks so much for your help. I really appreciate it!

1 Like

This should be fixed by

Thanks for the report

1 Like

Thank you for your help!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.