rstudio / bookdown

Authoring Books and Technical Documents with R Markdown
https://pkgs.rstudio.com/bookdown/
GNU General Public License v3.0
3.75k stars 1.26k forks source link

background bug with zenburn in gitbook output format #761

Open ChristopherBurgess-USDA opened 5 years ago

ChristopherBurgess-USDA commented 5 years ago

Hello,

I think this is a bug that was addressed in in rmarkdown issues #1471; however, the bug seems to be persistent when rendering a git book format. Essentially, the background color for the code blocks in the gitbook render are not the correct color.

output:
  bookdown::gitbook:
    highlight: zenburn

Session Info

> xfun::session_info('bookdown')
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.3 LTS, RStudio 1.2.1335

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

Package version:
  base64enc_0.1.3 bookdown_0.12   digest_0.6.20   evaluate_0.14   glue_1.3.1     
  graphics_3.6.1  grDevices_3.6.1 highr_0.8       htmltools_0.3.6 jsonlite_1.6   
  knitr_1.24      magrittr_1.5    markdown_1.1    methods_3.6.1   mime_0.7       
  Rcpp_1.0.2      rmarkdown_1.14  stats_3.6.1     stringi_1.4.3   stringr_1.4.0  
  tinytex_0.15    tools_3.6.1     utils_3.6.1     xfun_0.8        yaml_2.2.0   

By filing an issue to this repo, I promise that

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

cderv commented 3 years ago

I think we need to apply the same fix in the gitbook.html template https://github.com/rstudio/bookdown/blob/master/inst/templates/gitbook.html

I'll look into that. Thanks for the report and your patience with this issue!

For reference this is this part https://github.com/rstudio/rmarkdown/blob/145046175c721af185aa6ba3ecc9262f12dc7369/inst/rmd/h/default.html#L85-L105

also adding https://github.com/rstudio/rmarkdown/blob/145046175c721af185aa6ba3ecc9262f12dc7369/inst/rmd/h/default.html#L70

See https://github.com/rstudio/rmarkdown/commit/a0c0c681f03049a8e017d6ca5295160698cc17a1 and https://github.com/rstudio/rmarkdown/commit/13864b32207cac08ea711db1c75b79b6629d2661