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

Different html rendering when output is set to epub2 #2145

Closed
3 tasks done
flipacholas opened this issue Jun 29, 2022 · 3 comments · Fixed by #2146
Closed
3 tasks done

Different html rendering when output is set to epub2 #2145

flipacholas opened this issue Jun 29, 2022 · 3 comments · Fixed by #2146

Comments

@flipacholas
Copy link
Contributor


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.


My session:

R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur ... 10.16

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

Package version:
  base64enc_0.1.3 bslib_0.3.1     digest_0.6.29   evaluate_0.15  
  fastmap_1.1.0   fs_1.5.2        glue_1.6.2      graphics_4.2.1 
  grDevices_4.2.1 highr_0.9       htmltools_0.5.2 jquerylib_0.1.4
  jsonlite_1.8.0  knitr_1.39      magrittr_2.0.3  methods_4.2.1  
  R6_2.5.1        rappdirs_0.3.3  rlang_1.0.3     rmarkdown_2.14 
  sass_0.4.1      stats_4.2.1     stringi_1.7.6   stringr_1.4.0  
  tinytex_0.40    tools_4.2.1     utils_4.2.1     xfun_0.31      
  yaml_2.3.5     

Pandoc version: 2.18

I think there is (undesirable?) behaviour present when rendering epubs using the epub_version attribute set to epub2. Basically, after embedding images on a document with caption (using fig.caption), if the document is rendered using bookdown and epub_version is set to epub3 or epub, knitr will render <p class="caption"> block with the caption (as expected). On the other hand, if it's set to epub2, the caption block is not rendered.

At first, I thought this was an issue of bookdown, but I found this line that may be the culprit:

knitr/R/utils.R

Line 382 in 17ef462

fmts = c('markdown', 'epub', 'html', 'html4', 'html5', 'revealjs', 's5', 'slideous', 'slidy', 'gfm')

(probably should include "epub2" as well?)

@yihui
Copy link
Owner

yihui commented Jun 30, 2022

Yes, it should include epub2. Would you like to send a pull request? Thanks!

@flipacholas
Copy link
Contributor Author

Done!

@cderv cderv linked a pull request Jun 30, 2022 that will close this issue
@github-actions
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 Dec 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants